[Elasticsearch] Getting Started

Getting Started with Elasticsearch.

Elasticsearch is real-time, distributed, high availability, multi-tenant search server based on Apache lucene (A proven ultra fast search library written in Java). We can undoubtedly rely on lucene by the fact that its been used in many widely known open-source projects including high performance search server Solr.

Elasricsearch comes with a very powerful REST APIs with schema-free JSON based documents indexing and searching. The scalable and high-available nature of Elasticsearch and seamless integration with Logstash, Kibana makes it the most favourite choice for search server nowadays.

This is our first post of the Series in which we will learn how to set up Elasticseach server. So, Lets go

For this series my server configuration would be:

  • lsb_release -a
    Ubuntu 12.04 LTS 64 bit
  • java -version
    java version “1.7.0_75”
    OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~precise1)
    OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

Install/Update Java

If you have Java version less than 7 on your ubuntu machine, then update it:

$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk
$ sudo update-alternatives --config java

Download Elasticsearch

Now download the latest copy of elasticsearch like this (I am using 1.5.1):

$ wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.1.deb
--2015-04-27 15:23:59--  https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.1.deb
Resolving download.elastic.co (download.elastic.co)... 23.21.42.224, 23.21.137.61, 54.243.121.15, ...
Connecting to download.elastic.co (download.elastic.co)|23.21.42.224|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27002382 (26M) [application/x-debian-package]
Saving to: `elasticsearch-1.5.1.deb'

100%[================================================================================================================================>] 2,70,02,382 499K/s in 80s 

2015-04-27 15:25:22 (330 KB/s) - `elasticsearch-1.5.1.deb' saved [27002382/27002382]

Install Elasticsearch

$ sudo dpkg -i elasticsearch-1.5.1.deb 
    Selecting previously unselected package elasticsearch.
(Reading database ... 339339 files and directories currently installed.)
    Unpacking elasticsearch (from elasticsearch-1.5.1.deb) ...
    Setting up elasticsearch (1.5.1) ...
    Installing new version of config file /etc/init.d/elasticsearch ...
    Installing new version of config file /etc/elasticsearch/logging.yml ...
    Processing triggers for ureadahead ...

Verify the Elasticsearch Installation

$ sudo service elasticsearch status 
    * elasticsearch is not running

$ sudo service elasticsearch start
    * Starting Elasticsearch Server   

$ curl -XGET 'localhost:9200'
{
    "status" : 200,
        "name" : "Perseus",
        "cluster_name" : "elasticsearch",
        "version" : {
            "number" : "1.5.1",
            "build_hash" : "5e38401bc4e4388537a615569ac60925788e1cf4",
            "build_timestamp" : "2015-04-09T13:41:35Z",
            "build_snapshot" : false,
            "lucene_version" : "4.10.4"
        },
        "tagline" : "You Know, for Search"
}

Yipeee !!! We have now running Elasticsearch server. In further posts we will see how to configure Elasticsearch as per our need, till then, Happy Coding !!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.