Installing Elasticsearch on Linux

Download the Elasticsearch distribution, note the version you want to use

curl -L -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.3.4/elasticsearch-2.3.4.tar.gz
tar -xvf elasticsearch-2.3.4.tar.gz

Make sure you have Java 7. Verify by java -version. If not find out the value of $JAVA_HOME by using echo $JAVA_HOME. Download Java 7 and set the $JAVA_HOME value to the place where you have downloaded Java 7.

Adding elasticsearch user
1. Login as su
2. useradd elasticsearch
3. Donot select password so that this user cannot be used for shell login

Run Elasticsearch as sudo -H -u elasticsearch bin/elasticsearch -d. This runs elasticsearch as daemon.
Also to increase the heap size use ES_JAVA_OPTS="-Xms2g -Xmx2g", so the command becomes
sudo -H -u elasticsearch ES_JAVA_OPTS="-Xms2g -Xmx2g -Dcom.sun.management.jmxremote.port=8855 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" bin/elasticsearch -d

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s