Skip to content
Related Articles

Related Articles

How to Install and Configure Elasticsearch on Ubuntu ?
  • Last Updated : 27 Feb, 2020

Elasticsearch is a Cross-platform search engine based on Apache’s Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. It is written in Java.

Prerequisites: Java Installation on Ubuntu

Step 1: First, update your system by using the following command:

$sudo apt install update

Updating Ubuntu System

Step 2: Download .deb file for elasticsearch.



$wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.1/elasticsearch-2.3.1.deb

downloading deb file for elasticsearch

Step 3: Use dpkg commond to install the .deb file.

$sudo dpkg -i elasticsearch-2.3.1.deb

dpkg command to install .deb file

Step 4: Enable elasticsearch service

$sudo systemctl enable elasticsearch.service

Enable elasticsearch service

Step 5: Setup network configuration for elasticsearch. Open file

$sudo nano /etc/elasticsearch/elasticsearch.yml

and set IP as localhost

...
network.host: 127.0.0.1
...

Setup network configuration for elasticsearch

Step 6: Now, restart service.

$sudo systemctl restart elasticsearch

Step 7: Using and Testing Elasticsearch

$curl -X GET 'http://localhost:9200'

Output of curl

{
  "name" : "Node-1",
  "cluster_name" : "mycluster1",
  "version" : {
    "number" : "2.3.1",
    "build_hash" : "bd980929010aef404e7cb0843e61d0665269fc39",
    "build_timestamp" : "2016-04-04T12:25:05Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.0"
  }
}

Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :