Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
Last active August 29, 2015 14:26
Show Gist options
  • Save gregjhogan/dd804ae76c46e5989c53 to your computer and use it in GitHub Desktop.
Save gregjhogan/dd804ae76c46e5989c53 to your computer and use it in GitHub Desktop.
azure elasticsearch cluster
# azure vm list|grep LTS (to find latest ubuntu server image)
azure vm create es-cluster b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_2-LTS-amd64-server-20150706-en-us-30GB --location "Central US" --vm-name es-node-0 --vm-size ExtraSmall --ssh 22 --userName <username>
ssh es-cluster.cloudapp.net
# install java8
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
# install elasticsearch https://github.com/elastic/elasticsearch-cloud-azure
ELASTICSEARCH_VERSION=1.7.1
ELASTICSEARCH_AZURE_PLUGIN_VERSION=2.8.1
curl -s https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.deb -o elasticsearch-${ELASTICSEARCH_VERSION}.deb
sudo dpkg -i elasticsearch-${ELASTICSEARCH_VERSION}.deb
sudo service elasticsearch stop
sudo /usr/share/elasticsearch/bin/plugin -install elasticsearch/elasticsearch-cloud-azure/${ELASTICSEARCH_AZURE_PLUGIN_VERSION}
sudo vi /etc/elasticsearch/elasticsearch.yml
# begin file content
# If you don't remember your account id, you may get it with `azure account list`
cloud:
azure:
management:
subscription.id: your_azure_subscription_id
cloud.service.name: your_azure_cloud_service_name
keystore:
path: /home/elasticsearch/azurekeystore.pkcs12
password: your_password_for_keystore
discovery:
type: azure
# end file content
sudo service elasticsearch start
# test it out
curl http://localhost:9200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment