How to install Elasticsearch on CentOS/ Fedora/ RHEL

elasticsearch_logoElasticSearch is a distributed, RESTful, free/open source search server based on Apache Lucene. It is released under the terms of the Apache License. ElasticSearch is developed in Java.

We have to make sure that JAVA is installed on our machine before installing elasticsearch.

Please follow the steps described as here to install JAVA on your machine.

Now we will download and extract elasticsearch on the machine.

From this Location you can choose the latest version of elasticsearch.

Make sure you have configured JAVA_HOME environment variable properly. Use following commands to start elasticsearch.

To view the debugging messages on console start Elasticsearch on frontend using following command.

You have all done, just need to verify setup. elasticsearch works on port 9200, open your browser to point your server on port 9200, You will find some thing like below output

Examples of Data Indexing

Following examples will help to add, get and search data in Elasticsearch.
1. Adding Data to Elasticsearch

Use following commands to add some data in elasticsearch.
Command 1:

Command 2:

Command 3:

2. Get Data from Elasticsearch

Use following command to GET data from Elasticsearch and read the output.

3. Search in Elasticsearch

Use following command to search data from elastic search. Below command will search all data assiciated with user tapas.

The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

Leave a Reply