Elasticsearch
Elasticsearch is distributed search engine, provides REST API and schema-free JSON documents.
Installing and configuring Elasticsearch is a easy method.
Let’s jump into Installation of Elasticsearch.
Download elasticsearch from the official site. I am gonna use TAR file in this tutorial, and version I followed here is elasticsearch-2.3.3Elastic search version 2.3.3
Use the below command to download TAR file using wget and extract it.
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.3.3/elasticsearch-2.3.3.tar.gz wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/{VERSION}/elasticsearch-{VERSION}.tar.gz tar -xvf elasticsearch-2.3.3.tar.gz tar -xvf elasticsearch-{VERSION}.tar.gz
Once you have download and extracted the elasticsearch, start eh elastic search application in the bin folder. Refer the below command to start.
As I have told you at first, deploying elasticsearch in single node seems very easy right. 🙂
cd elasticsearch-2.3.3/ ./bin/elasticsearch # OR ./bin/elasticsearch -d
First option will start elasticsearch in same session and once you will close or exit of the session, this will terminate the application, more over this will print everything on the screen. you can use this option to check, if the application is working fine.
use the second option to start elasticsearch independently. This will start in it background. After starting the elasticsearch, query it and check whether its started or not.
By default elasticsearch starts with port 9200.
curl -XGET ‘http://localhost:9200’
See the below result you will get it. This means, your elastic search is started. Every time you start, you will get different name “Super-Skrull”.

CURL Localhost – Elasticsearch
Configure ElasticSearch
We have successfully, installed Elasticsearch, lets configure it.
All the configuration goes into ./config/elasticsearch.yml
Cluster Name

Elasticsearch
First we will set the name for the Elastic search cluster.
uncomment cluster.name: and set name of your own.
Then look into configuring the host and port.
Host
If you want to access elasticsearch outside through REST Client or if you have used Amazon EC2 instance and you want to access it everywhere, then you should enable network.host and set to 0.0.0.0.
Port
Run server in different port, if you have some other service using the 9200 port, you can make the elasticsearch to use different one by enabling http.port and set the port number.
Log
Set different location for logs, by default, logs folder will be created in the { home_dir } and all the logs are written to it, if you want to use the standard log directory of Linux, set the path in the config file in path.logs:. This will create the destination directory, if it doesn’t exist, but make sure that the user, who is running elasticsearch should have the permission to write logs.
Data
Set different or Multiple location for data. uncomment path.data:. and set your preferred location. you can set multiple location by adding values comma separated or in array. This option will also create the destination directory if not exist. Make sure it has write permissions
All the explained configurations are defined below.
#Define your own cluster name cluster.name: boopathik-ElasticSearch Cluster #Enable network.host and use different port network.host: 0.0.0.0 #here am using 9202 port http.port: 9202 #set standard log location of unix path.logs: /var/log/ElasticSearch # define path from different location to store data, multiple location by comma seperated or in an array path.data: /opt/ElasticSearchData/ES_Data1, /opt/ElasticSearchData/ES_Data2 path.data: ["/opt/ElasticSearchData/ES_Data1", "/opt/ElasticSearchData/ES_Data2"]
once you have made all the above configuration, stop and start the elastic search and now your elasticsearch will be running in port 9202 and you can access it in browser and REST client also. Access it from browser “http://<<IP>>:<<port>>”
curl -XGET ‘http://localhost:9202’

CURL localhost – Elasticsearch
From the above image, you can see the port number 9202 and with different cluster name, not the default one.
From my Next post, I will explain you how to install and configure Elasticsearch in Cluster.