# Elasticsearch 9.x on RHEL

This article describes the steps required to install and configure Elasticsearch on a Red Hat Enterprise Linux (RHEL) server for use with OvalEdge. It includes repository configuration, package installation, service management, and security configuration. Follow the steps in the order provided to ensure a successful installation.

## Prerequisites

Before starting the installation, ensure the following prerequisites are met:

* A supported Red Hat Enterprise Linux (RHEL) server is available.
* Java is installed on the server.
* Root or sudo access is available.
* Internet access is available to download the Elasticsearch packages.
* Required ports are open:
  * 9200 for HTTP communication
  * 9300 for transport communication

### Install Elasticsearch GPG Key

1. Import the Elasticsearch GPG key:

   ```
   sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
   ```

### Add the Elasticsearch Repository

1. Create the Elasticsearch repository file:

   ```
   sudo vi /etc/yum.repos.d/elasticsearch.repo
   ```
2. Add the following content to the repository file:

   ```
   [elasticsearch]
   name=Elasticsearch repository
   baseurl=https://artifacts.elastic.co/packages/9.x/yum
   gpgcheck=1
   gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
   enabled=1
   autorefresh=1
   type=rpm-md
   ```

### Install Elasticsearch

1. Install Elasticsearch using one of the following commands:

   ```
   sudo dnf install -y elasticsearch
   ```

   \
   Or

   ```
   sudo yum install -y elasticsearch
   ```

### Configure Elasticsearch

1. Open the Elasticsearch configuration file:

   ```
   sudo vi /etc/elasticsearch/elasticsearch.yml
   ```
2. Update the following configuration properties:

   ```
   cluster.name: ovaledge
   network.host: 0.0.0.0
   transport.host: localhost
   transport.tcp.port: 9300
   http.port: 9200
   ```

### Enable and Start the Elasticsearch Service

1. Reload the systemd manager configuration:

   ```
   sudo systemctl daemon-reexec
   ```
2. Enable Elasticsearch to start automatically during system boot:

   ```
   sudo systemctl enable elasticsearch
   ```
3. Start the Elasticsearch service:

   ```
   sudo systemctl start elasticsearch
   ```
4. Verify the service status:

   ```
   sudo systemctl status elasticsearch.service
   ```

   \
   Sample Reference Screenshot:

   <figure><img src="/files/jJ7vjuphqVOVYSgnFn3Y" alt=""><figcaption></figcaption></figure>

### Enable Security and Set the Password

1. Open the Elasticsearch configuration file:

   ```
   sudo vi /etc/elasticsearch/elasticsearch.yml
   ```
2. Add the following property:

   ```
   xpack.security.enabled: true
   ```
3. Restart the Elasticsearch service:

   ```
   sudo systemctl restart elasticsearch
   ```
4. Run the following command to reset the password for the elastic user:

   ```
   sudo /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
   ```
5. Enter and confirm the password when prompted.

### Verify the Installation

1. Access Elasticsearch using the following URL:

   ```
   http://<IP>:9200
   ```
2. Confirm that Elasticsearch is running and responding.&#x20;

***

Copyright © 2026, OvalEdge LLC, Peachtree Corners, GA, USA.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ovaledge.com/release8.1/deployment-and-maintenance/installation/elasticsearch-9.x-on-rhel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
