Installation of Elasticsearch 8.x on Ubuntu


This document provides a comprehensive guide on installing and configuring Elasticsearch on a Ubuntu environment. The instructions cover the installation process, configuration settings, and integration with the OvalEdge (OE) application.

Elasticsearch Server Installation

Step#1: Install APT Transport Package

  • Install the APT transport package to enable access to repositories via HTTPS:


$ sudo apt install apt-transport-https

Sample screenshot

Step#2: Update Elasticsearch Repository

  • Update the Elasticsearch repository and import the GPG key:


$ wget -qO - | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg

  • Use the wget command to pull the Public Key:


$ echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list

Sample screenshot

Step#3: Install Elasticsearch

  • Install Elasticsearch using APT:


$ sudo apt-get update

$ sudo apt-get install elasticsearch

Sample screenshot

Step#4: Reload and Start Elasticsearch Service

  • Reload the daemon service and enable/start the Elasticsearch service:


$ sudo systemctl daemon-reload

$ sudo systemctl enable elasticsearch.service

$ sudo systemctl start elasticsearch.service

Sample screenshot

Step#5: Check Elasticsearch Status

  • Check the status of Elasticsearch:


$ sudo systemctl status elasticsearch.service

Sample screenshot

Configure Elasticsearch

Step#6: Edit elasticsearch.yml

  • Edit the Elasticsearch configuration file to customize settings:


$ sudo vim /etc/elasticsearch/elasticsearch.yml

  • Add the following lines at the bottom of the file:

yaml ovaledge localhost

transport.tcp.port: 9300

http.port: 9200

Sample screenshot

Step# 7: Set Up Elastic User Password

  • Navigate to the Elasticsearch bin directory and set up a password for the Elastic user:


$ sudo ./elasticsearch-setup-passwords interactive

Sample screenshot

Step#8: Check Elasticsearch Web Response

  • Check the web response of Elasticsearch:


$ curl http://<IP>:9200

Sample screenshot

Step#9: Set Up JVM_HEAP

  • Update JVM settings to restrict Elasticsearch memory usage. Copy the jvm.options file to the jvm.options.d folder and set values:


$ cp /etc/elasticsearch/jvm.options /etc/elasticsearch/jvm.options.d/

$ sudo vim /etc/elasticsearch/jvm.options.d/jvm.options

  • Set the values:


-Xms5g -Xmx5g

Integrating Elasticsearch with OvalEdge

Step#10: Edit Oasis Properties

  • Edit the Oasis properties file in the OE application running on the server:


$ sudo vim /path/to/oasis/properties

  • Update Elasticsearch details:


ES hostname: <domain>

ES password: *******

Note: The password was set during the Elasticsearch installation.

Sample screenshot

Step#11: Restart Tomcat

  • After editing the Elasticsearch details in the Oasis properties, restart Tomcat:


$ sudo systemctl restart tomcat