Pre- Requisites :-

Before installation, we have to setup java latest version 7u79 from oracle.

Care must be taken to have installation of oracle java only in the server. In other words,  don’t install two java’s on same machine like openJDK and oracle jdk.

Download Link :

The latest version of Elasticsearch can be downloaded from the following link for any platform.

https://www.elastic.co/downloads/elasticsearch

Installing ElasticSearch on Windows :

Note : For windows we need compatible jdk 7 and install it by double clicking on .exe file

Below steps will come in handy for the installation.

Step 1 :

Download windows .zip from elastic site.



 Step 2:  

Unzip it.The following is the directory layout of elasticsearch.

   Before starting elastic server :



Step3:

Now start server by double click on the elasticsearch.bat file.    

Note : But this is normal start, as when we close the command prompt it will shoot the es server down automatically. That means we need to run it as a service on windows

Step 4 :

Plain text
1​c:\elasticsearch-{version}bin>service install
2Installing service : "elasticsearch-service-x64"
3Using JAVA_HOME (64-bit): "c:\jvm\jdk1.7"
4The service 'elasticsearch-service-x64' has been installed.



Step 5 :  ​

Then enter the following command to start elasticsearch backend as service.

Plain text
1C:\phani\elasticsearch-1.6.0\bin>service.bat start

The service 'elasticsearch-service-x64' has been started.

Step6 :

Go to browser and check    or :9200 then it is return status 200 on browser like following.



Installing ElasticSearch on Ubuntu :

Shell
1Java Installation : oracle jdk for ubuntu.
2sudo add-apt-repository ppa:webupd8team/java
3sudo apt-get update
4sudo apt-get install oracle-java7-installer
5java -version
6set JAVA_HOME path in “/etc/profile” as
7export JAVA_HOME=’/usr/java/jdk1.7.0_55’

Step1 :

Download .deb package from the following url.

https://www.elastic.co/downloads/elasticsearch



Step 2 :  

 Login as root user and install .deb package

Plain text
1dpkg -i elasticsearch-1.6.0.deb

             The es got installed in your server now; change the configuration file elasticsearch.yml according to your needs.

Note: Make sure that before starting elasticsearch server you change the configurations.

Step 3 :  ​

Now operate following commands

To add services.

Shell
1sudo update-rc.d elasticsearch defaults 95 10
2start elastic serve r:
3sudo /etc/init.d/elasticsearch start

Step 4 :  

Verify by typing localhost:9200 in browser.

It should return response 200 and if it appears then our installations is success.       

Installing ElasticSearch on CentOS/RHEL :

For centos/RHEL directly we can use yum  install oracle-java7-installer

Then it will install java on server

set the JAVA_HOME path on “/etc/profile”.

Step 1:

Download .rpm package from url : https://www.elastic.co/downloads/elasticsearch



Step 2 :

Use rpm -ivh elasticsearch.rpm

This will install elasticsearch.

Step 3 :​

Add elasticsearch process to chkconfig like following

Shell
1sudo /sbin/chkconfig --add elasticsearch

Step 4 : 

Change the configurations we required in elasticsearch.yml file and start elastic search using following command.

sudo service elasticsearch start

Step 5 :

Check elasticsearch running or not by typing localhost/ip:9200 in browser it should return 200 response from server.

RHEL/Cent OS file locations on server :

JavaScript
1ES_HOME=/usr/share/elasticsearch
2LOG_DIR=/var/log/elasticsearch
3DATA_DIR=/var/lib/elasticsearch
4WORK_DIR=/tmp/elasticsearch
5CONF_DIR=/etc/elasticsearch
6CONF_FILE=/etc/elasticsearch/elasticsearch.yml

Ubuntu/Debian file locations :

JavaScript
1ES_HOME=/usr/share/elasticsearch
2LOG_DIR=/var/log/elasticsearch
3DATA_DIR=/var/lib/elasticsearch
4WORK_DIR=/tmp/elasticsearch
5CONF_DIR=/etc/default/elasticseach
6CONF_FILE=/etc/elasticsearch/elasticsearch.yml