Step-by-Step Guide to Installing OpenSearch on Rocky Linux 9

OpenSearch is a vibrant community-driven project led by Amazon, following a fork of Elasticsearch and Kibana. It offers a comprehensive open-source search engine and analytics suite packed with robust features and dynamic functionalities. OpenSearch’s core components include OpenSearch, a fork of Elasticsearch, and the OpenSearch Dashboards, a fork of Kibana. Both components provide features such as enterprise security, alerting, machine learning, SQL, index state management, and more.

OpenSearch is fully open-source and licensed under the Apache 2.0-license, allowing for seamless data ingestion, security, search, aggregation, view, and analysis. Use cases include log analytics, application search, enterprise search, and more.

This guide details the installation of OpenSearch, a robust open-source search, analytics, and visualization suite, on a Rocky Linux 9 server. It includes securing your OpenSearch deployment using TLS/SSL certificates and establishing authentication and authorization within OpenSearch.

We also cover the installation of OpenSearch Dashboards, a visualization tool akin to Kibana, and its configuration to connect to OpenSearch. By the end of this article, you will have a fully functional data analytics and visualization suite on your Rocky Linux server.

Prerequisites

  • A server running Rocky Linux 9 with at least 4GB of RAM. This setup uses a Rocky Linux server identified as ‘node-rock1‘ with an IP address of ‘192.168.5.25‘ and 8GB of RAM.
  • A non-root user with sudo or root privileges.
  • SELinux set to permissive mode.

System Setup

Prepare your Rocky Linux host by setting an appropriate hostname and FQDN, disabling SWAP, and increasing the maximum maps memory on your system. Log in to your server and execute the commands below:

        sudo hostnamectl set-hostname node-rock1
        echo '192.168.5.25 node-rock1.hwdomain.lan node-rock1' >> /etc/hosts

Check your FQDN using:

sudo hostname -f

setup fqdn

Disable SWAP to improve performance:

        sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
        sudo swapoff -a

Verify SWAP status:

free -m

disable swap

Increase max maps memory:

        sudo echo "vm.max_map_count=262144" >> /etc/sysctl.conf
        sudo sysctl -p
cat /proc/sys/vm/max_map_count

setup vm max

Installing OpenSearch

Install OpenSearch by adding its repository and installing the package. Run:

        sudo curl -SL https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/opensearch-2.x.repo -o /etc/yum.repos.d/opensearch-2.x.repo
        sudo dnf repolist

verify list repos

View available packages:

sudo dnf info opensearch

Install OpenSearch:

sudo dnf install opensearch

Be sure to accept the GPG key when prompted.

install opensearch

Start and enable OpenSearch:

        sudo systemctl daemon-reload
        sudo systemctl start opensearch
        sudo systemctl enable opensearch

start enable opensearch

Verify OpenSearch status:

sudo systemctl status opensearch

verify opensearch

FAQ

What is OpenSearch?

OpenSearch is an open-source search and analytics suite, initiated as a community-driven project by Amazon, which is a fork of Elasticsearch and Kibana.

How is OpenSearch licensed?

OpenSearch is licensed under the Apache 2.0 license, ensuring it’s fully open-source.

What are some use cases for OpenSearch?

OpenSearch can be utilized for various purposes such as log analytics, application search, enterprise search, and more advanced analytics and data exploration tasks.

What components make up the OpenSearch project?

The OpenSearch project consists mainly of OpenSearch for search functionalities, and OpenSearch Dashboards for data visualization and user interface tasks.

What is the prerequisite RAM for installing OpenSearch on Rocky Linux 9?

A minimum of 4GB RAM is required, though 8GB is recommended for better performance.