Elasticsearch is used to store and search all kinds of documents. It supports full-text search completely based on the documents instead of tables and schema. This tutorial will help you to setup Elasticsearch single node cluster on CentOS 8 and RedHat 8 systems.

Prerequisites

Java is the primary requirement for installing Elasticsearch on any system. You can check the installed version of Java by executing the following command. If it returns an error, install Java on your system using this tutorial. After installation, check the Java version:

Step 1 – Configure Yum Repository

The first step is to configure Elasticsearch package repository on your system. Run the following command to install GPG key for the Elasticsearch rpm packages. Next, create a yum repository configuration file for the Elasticsearch. Edit /etc/yum.repos.d/elasticsearch.repo file in your favorite text editor: Add below content:

Step 2 – Installing Elasticsearch

Your system is prepared for the Elasticsearch installation. Run the following commands to update DNF cache and install the Elasticsearch rpm packages on your system.

Step 3 – Configure Elasticsearch

After successful installation edit Elasticsearch configuration file “/etc/elasticsearch/elasticsearch.yml” and set the network.host to localhost. You can also change it to the system LAP IP address to make it accessible over the network. Set the following values to customize your Elasticsearch environment. Save file and close. After making configuration changes, let’s enable the Elasticsearch service and start it. Your Elasticsearch server is up and running now. To view status of the service, run below command: Output:

Step 4 – Test Elasticsearch

The Elasticsearch has been successfully installed and running on your CentOS 8 or RHEL 8 system. Now, you can use it for storing and searching content. Run the following command to view the Elasticsearch server configuration and version details: You will see the results like below:

Conclusion

In this tutorial, You have learned to install and configure Elasticsearch on CentOS 8 / RHEL 8 Linux system.