# Elasticsearch 7.17.x on RHEL 8+

This article provides a comprehensive guide for installing Elasticsearch version 7.17.x on Ubuntu 22.04, Amazon Linux, and RHEL 8.x systems. It includes prerequisites, installation steps, configuration instructions, and integration steps with the OvalEdge application.

### Hardware Requirements

* Minimum 4 GB RAM (8 GB recommended)
* Minimum 2 vCPUs
* 10 GB available disk space

### Prerequisites

* Ubuntu system with version 22.04 or later
* User with sudo privileges
* Stable internet connection
* Java 17 installed (or to be installed during the process)

## Elasticsearch Installation on RHEL 8.x

### Install Java 17

* Elasticsearch requires Java 17. Install it with the following command. If Java is already installed, verify using the version check command.

  ```bash
  sudo yum install java-17-openjdk -y  
  ```

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FoKFZZGBUytlBaZJfx0Bl%2Fimage.png?alt=media&#x26;token=106c0b05-3465-4882-87f3-9b5532af96af" alt=""><figcaption></figcaption></figure>

  ```bash
  java -version 
  ```

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2Fjc8oLWhAXS5wT9C4PCST%2Fimage.png?alt=media&#x26;token=ee38047e-3dc4-4cc5-ae02-0b14bb083225" alt=""><figcaption></figcaption></figure>

### Import the Elasticsearch GPG Key

* Add the official GPG key to verify package authenticity.

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

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FL8UALiexdtAL6uUpE81q%2Fimage.png?alt=media&#x26;token=f6a01608-1204-4a0c-8618-425e6bcb4073" alt=""><figcaption></figcaption></figure>

### Add the Elasticsearch YUM Repository

* Create the repository file for Elasticsearch packages:

  ```bash
  sudo vi /etc/yum.repos.d/elasticsearch.repo  
  ```

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FXVGLVoRJQUsdwwd5b97D%2Fimage.png?alt=media&#x26;token=e5769e21-8b51-4011-97a6-acb218de3437" alt=""><figcaption></figcaption></figure>
* Insert the following content:

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

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F1e70MJXUxNAE2qCgx3Qu%2Fimage.png?alt=media&#x26;token=14484322-2953-44b3-bb02-b6c65c9ec502" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Ensure there are no typos in the `baseurl` or `gpgkey` to avoid installation issues.
{% endhint %}

## Install Elasticsearch

* Update the package index and install Elasticsearch:

  ```bash
  sudo yum update -y  
  sudo yum install elasticsearch -y  
  ```

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FpDCoT2z7A9AJz9PBMODJ%2Fimage.png?alt=media&#x26;token=938cedf5-37c3-4999-ad78-fcc4d3be7254" alt=""><figcaption></figcaption></figure>

### Enable and Start the Elasticsearch Service

* Reload the systemd configuration to register the new service.
* Enable Elasticsearch to start on system boot:

  ```bash
  sudo systemctl daemon-reexec  
  ```
* Enable Elasticsearch to start on system boot:

  ```bash
  sudo systemctl enable elasticsearch.service   
  ```

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FBV5CvB7j3VHUqmgInEny%2Fimage.png?alt=media&#x26;token=720590a5-4597-4c89-9c66-3fdfe5c62e73" alt=""><figcaption></figcaption></figure>
* Start the service and verify its status:

  ```bash
  sudo systemctl daemon-reexec  
  sudo systemctl enable elasticsearch.service  
  sudo systemctl start elasticsearch.service  
  sudo systemctl status elasticsearch.service  
  ```

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2Ff1qytmG5zoBDnh5Kn1ml%2Fimage.png?alt=media&#x26;token=7b373b57-7487-4ded-b2c3-d123cb6e1a07" alt=""><figcaption></figcaption></figure>
* At this point, Elasticsearch is installed and running.

## Configure Elasticsearch

### Update elasticsearch.yml

* Edit the configuration file at `/etc/elasticsearch/elasticsearch.yml`:

  ```bash
  sudo vim /etc/elasticsearch/elasticsearch.yml  
  ```
* Add or modify the following settings:

  ```yaml
  cluster.name: ovaledge  
  network.host: 0.0.0.0  
  transport.host: localhost  
  transport.tcp.port: 9300  
  http.port: 9200  
  xpack.security.enabled: true  
  ```

These settings configure the node to:

* Be accessible from external networks (`network.host: 0.0.0.0`)
* Use custom cluster and port settings
* Enable security features for authentication

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2Fc1lXdxL6pNXzuJcYYSp3%2Fimage.png?alt=media&#x26;token=16a6fd01-76d9-4999-a128-2933457861f8" alt=""><figcaption></figcaption></figure>

### Restart Elasticsearch

* Restart the service to apply the configuration changes:

  ```bash
  sudo systemctl restart elasticsearch.service  
  sudo systemctl status elasticsearch.service  
  ```

## Setting Up Passwords

To secure the installation, set passwords for the built-in reserved users. These accounts are used by Elastic Stack components for internal authentication.

#### Navigate to the Elasticsearch Binary Directory

```bash
cd /usr/share/elasticsearch/bin  
```

#### Run the Password Setup Script

* Use interactive mode to configure passwords:

  ```bash
  sudo ./elasticsearch-setup-passwords interactive  
  ```

When prompted:

* Press `y` to continue

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FdsYOrviLRN0uW5pO3ZTU%2Fimage.png?alt=media&#x26;token=d52b4ff7-1d86-4b25-b9cd-3a9bf709d842" alt=""><figcaption></figcaption></figure>
* Provide passwords for the following users:
  * `elastic`, `kibana_system`, `logstash_system`, `beats_system`, `apm_system`, `remote_monitoring_user`&#x20;
* It is recommended to use the same password for all users for ease of configuration unless stricter separation is required.

{% hint style="info" %}
**Note:** Store these credentials securely, as they are required for configuring clients such as Kibana, Logstash, and OvalEdge.
{% endhint %}

## Integration with the OvalEdge Application

### Locate and Open the Configuration File

* Navigate to the `extprop` directory inside the OvalEdge installation folder:

  ```bash
  cd /<path_to_ovaledge>/extprop  
  sudo vi oasis.properties  
  ```

### Update Elasticsearch Properties

* Modify or add the following entries:

  ```properties
  es.host=<elasticsearch_host>  
  es.port=9200  
  es.protocol=http  
  es.username=elastic  
  es.password=<elastic_password>  
  ```
* `es.host`: Use `localhost` if Elasticsearch is on the same VM as OvalEdge. Otherwise, provide the server’s IP address.
* `es.password`: Use the password configured for the `elastic` user.

### Restart Tomcat

* After saving the changes, restart Tomcat:

  ```bash
  sudo systemctl restart tomcat  
  ```

<figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F1ky2hZ7B98sEIq4jUEgG%2Fimage.png?alt=media&#x26;token=99d97922-27cd-491b-ac5f-79ea127a0a65" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important:** Ensure the Elasticsearch service is running and accessible from the OvalEdge server before restarting Tomcat.
{% endhint %}

***

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