Skip to content

Instantly share code, notes, and snippets.

@buth
Created November 13, 2014 18:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buth/65708a902828a464ab54 to your computer and use it in GitHub Desktop.
Save buth/65708a902828a464ab54 to your computer and use it in GitHub Desktop.
Cloud-init script for setting up Elastic Search on Ubuntu
#!/bin/bash
echo "127.0.0.1 `hostname`" >> /etc/hosts
apt-get update
apt-get -y upgrade
apt-get -y install openjdk-7-jre
cd /tmp
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.deb
dpkg -i elasticsearch-1.1.0.deb
echo 'ES_HEAP_SIZE=6g' >> /etc/default/elasticsearch
echo 'cluster.name: awesomecluster
bootstrap.mlockall: true
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["IP OF EXISTING SERVER","IP OF EXISTING SERVER"]
' >> /etc/elasticsearch/elasticsearch.yml
/etc/init.d/elasticsearch start
update-rc.d elasticsearch defaults 95 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment