Skip to content

Instantly share code, notes, and snippets.

@karussell
Last active May 4, 2021 10:13
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save karussell/3131213 to your computer and use it in GitHub Desktop.
Save karussell/3131213 to your computer and use it in GitHub Desktop.
setup ElasticSearch on EC2
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.deb
sudo dpkg -i elasticsearch-0.19.8.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
# if you want to remove it:
sudo dpkg -r elasticsearch
# start script
/etc/init.d/elasticsearch
# binaries & plugin
/usr/share/elasticsearch/bin
# log dir
/var/log/elasticsearch
# data dir
/var/lib/elasticsearch
# config dir
/etc/elasticsearch
# important: default configs will be overwritten from here:
/etc/default/elasticsearch
# prepare ElasticSearch UI
sudo apt-get install apache2
sudo mkdir /var/www/ui
sudo chown -R ubuntu.www-data /var/www
# now copy ES-HEAD to /var/www/ui
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["xy2.compute.amazonaws.com"]
# and on other node use:
# discovery.zen.ping.unicast.hosts: ["xy1.compute.amazonaws.com"]
# to use ec2 api (you need the security keys!) for discovery you need to install the aws plugin
# read
# http://www.elasticsearch.org/tutorials/2011/08/22/elasticsearch-on-ec2.html
# http://www.elasticsearch.org/guide/reference/modules/discovery/ec2.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment