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 :
1c:\elasticsearch-{version}bin>service install2Installing 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.
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 :
1Java Installation : oracle jdk for ubuntu.2sudo add-apt-repository ppa:webupd8team/java3sudo apt-get update4sudo apt-get install oracle-java7-installer5java -version6set JAVA_HOME path in “/etc/profile” as7export 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
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.
1sudo update-rc.d elasticsearch defaults 95 102start 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
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 :
1ES_HOME=/usr/share/elasticsearch2LOG_DIR=/var/log/elasticsearch3DATA_DIR=/var/lib/elasticsearch4WORK_DIR=/tmp/elasticsearch5CONF_DIR=/etc/elasticsearch6CONF_FILE=/etc/elasticsearch/elasticsearch.yml
Ubuntu/Debian file locations :
1ES_HOME=/usr/share/elasticsearch2LOG_DIR=/var/log/elasticsearch3DATA_DIR=/var/lib/elasticsearch4WORK_DIR=/tmp/elasticsearch5CONF_DIR=/etc/default/elasticseach6CONF_FILE=/etc/elasticsearch/elasticsearch.yml



