Install Elasticsearch on CentOS

Elasticsearch, from its name, can you also guess that it is related to search? It is a search engine built from Apache Lucene that helps us to search quickly using RESTful Web Service. It was developed using Java language and is a distributed system, easily expandable. In this tutorial, I will show you how to install Elasticsearch on CentOS.

First, because the default CentOS repository does not contain the Elasticsearch installation package, we need to add the Elasticsearch repository.

To do this, run the following command to add the Elasticsearch public signing key to your computer, to the package manager of your OS trusts package from the Elasticsearch repository:

My results are as follows:

Install Elasticsearch on CentOS

Next, you need to create a new file to add the Elasticsearch repository:

then add to the file the following content:

Now you can start installing Elasticsearch,

Please run the following command:

You will see that Elasticseach is installed as follows:

Install Elasticsearch on CentOS

Enter “Y” to continue!

Results of installation:

Install Elasticsearch on CentOS

By default, Elasticsearch will run on port 9200 and can only be accessed by the localhost. You can edit the configuration of Elasticsearch at /etc/elasticsearch/elasticsearch.yml to change these.

After editing is complete, you can start the Elasticseach service using the command:

Run Elasticsearch at machine startup:

Now, if you open your browser and go to http://localhost:9200, you will see the following result:

Install Elasticsearch on CentOS

Add Comment