How to install Elasticsearch on CentOS 7?

0
491
searching
searching

Linux is a great operating system and many companies rely on it for their business solutions. That is why more and more projects are born to be implemented in them. In this article, I will explain how to install Elasticsearch in CentOS 7.

In short, Elastichsearch is a document-oriented search engine that allows us to index a large volume of data to make queries about them later. It’s open source licensed under the Apache License 2.0. With this in mind, let’s install Elasticsearch.

0. What you need

To install Elasticsearch on CentOS7, you need in a first place, get administrator privileges, to perform the commands correctly.

Then, you need a machine with CentOS 7 and the possibility of accessing the server through ssh.

It is always useful to have knowledge about the use of the terminal.

1.- Upgrading the System and Installing Java

We are going to perform the installation on a server, this implies that we must always have updated packages in order to always get the latest security patches.

To become a root user, type in the terminal:

After entering the root password, we will be able to upgrade the system.

1.- Upgrading the system
1.- Upgrading the system

Before starting to install Elasticsearch, you must make sure you have Java on your computer as the application requires it.

2.- Installing OpenJDK
2.- Installing OpenJDK

When the installation is finished, you can run the following command to be sure of it.

3.- Showing Java installed version
3.- Showing Java installed version

2.- Install Elasticsearch

A simple and practical way to install Elasticsearch is to do it through your .rpm packages. This is very useful if you need to install it in other distributions like Suse or RHEL.

First, download the packages:

4.- Downloading the packages
4.- Downloading the packages

The first is the program itself, the second package is to verify its integrity, something vital because you are doing the installation on a server.

After downloading the packages, it is necessary to check them.

5.- Verifying the packages
5.- Verifying the packages

And finally, install the packages.

6.- installing elasticsearch
6.- installing Elasticsearch

Then it’s your turn to set up the Elasticsearch service in order to enable and initialize it.

7.- Enabling Elasticsearch service
7.- Enabling Elasticsearch service

3. Check that Elasticsearch is working

Now that you have installed Elasticsearch, you must check that everything is in order, to do so, run:

You must remember or know that Elasticsearch uses port 9200 by default. That’s why the command makes an inspection of the applications that use the mentioned port.

You can also check /var/log/elasticsearch/elasticsearch.log for errors.

A small configuration and Conclusion

It is possible to make Elasticsearch listen to a single IP in particular. Open the file /etc/elasticsearch/elasticsearch.yml.

8.- Elasticsearch - listening on particular IPv4
8.- Elasticsearch – listening on particular IPv4

You can also further protect the instance by disabling public access. In that same file, add the following at the end.

9.- Disabling public access to Elasticsearch
9.- Disabling public access to Elasticsearch

Then, restart the service.

As a conclusion, it can be said that Elasticsearch is a solution intended for large data and companies but is still easy to install on a server with CentOS.

We want to know about your experience, have you used elasticsearch?

Please share this article on your social networks.

Spread the love
  • 2
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here