Skip to content

Instantly share code, notes, and snippets.

@msolujic
Last active September 25, 2015 08:04
Show Gist options
  • Save msolujic/9207419 to your computer and use it in GitHub Desktop.
Save msolujic/9207419 to your computer and use it in GitHub Desktop.
Install ElasticSearch and Kibana on EC2 centos machine

##Setup initial dependences

sudo yum update 
sudo yum install wget
sudo yum install curl
sudo yum install httpd

##Setup ElasticSearch

###Get latest stable ElasticSearch distribution

cd /opt/
sudo wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.0.tar.gz
sudo tar -zxvf elasticsearch-1.0.0.tar.gz
sudo rm elasticsearch-1.0.0.tar.gz
sudo mv elasticsearch-1.0.0 elasticsearch

###Make it to run as a service

cd ~
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
sudo mv *servicewrapper*/service /opt/elasticsearch/bin/
rm -Rf *servicewrapper*
sudo /opt/elasticsearch/bin/service/elasticsearch install
# run on boot
sudo /sbin/chkconfig elasticsearch on
sudo /sbin/chkconfig --list

sudo nano /opt/elasticsearch/bin/service/elasticsearch.conf

find ES_HEAP_SIZE and set it to half of available RAM memory (in MB)

Restart service to pickup latest changes

sudo service elasticsearch restart
tail -f /etc/elasticsearch/logs/elasticsearch.log

##Setup Kibana

Get it and unpack

#check if Apache is running
sudo /etc/init.d/httpd  restart

cd ~
wget https://download.elasticsearch.org/kibana/kibana/kibana-3.0.0milestone5.tar.gz
wget https://download.elasticsearch.org/kibana/kibana/kibana-3.0.0milestone5.tar.gz
tar -zxvf kibana-3.0.0milestone5.tar.gz 
rm kibana-3.0.0milestone5.tar.gz
mv kibana-3.0.0milestone5 kibana
sudo mv kibana /var/www/html/

AWS note: Make sure you open ports 9200 and 9300 in security group to which this machine is set.

Congrats you've setup ElasticSearch and kibana.

Point your browser to freshly installed kibana:

[public_dns]/kibana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment