How To Install Elasticsearch on Rocky Linux 9

To install Elasticsearch on Rocky Linux 9, follow the steps below.

Step 1 : Ensure your system is up-to-date by running the following command:

Step 2 : Install Java on your system. Elasticsearch requires Java, so make sure to install OpenJDK.

Step 3 : Verify the Java installation by checking the version.

Step 4 : Import the Elasticsearch PGP key to ensure the integrity of the packages.

Step 5 : Create a file named elasticsearch.repo in the /etc/yum.repos.d/ directory and add the following code:

Add the following content:

Step 6 : Install Elasticsearch using the following command:

Step 7 : Start the Elasticsearch service:

Step 8 : Enable Elasticsearch to start on boot:

Step 9 : Open the Elasticsearch configuration file:

Find the line xpack.security.enabled and set it to true.

Step 10 : Restart the Elasticsearch service:

Step 11 : Verify the status of Elasticsearch:

Step 12 : Reset the password for the elastic user:

Step 13 : Verify the installation by making a request to Elasticsearch using curl:

Congratulations! You have successfully installed and configured Elasticsearch on Rocky Linux 9.