OpenSearch is a highly scalable and open-source search engine created as a fork of Elasticsearch and Kibana by AWS team. OpenSearch enables Developers to store, manage, and analyze large volumes of data using its powerful text-search functionalities powered by Apache Lucene. OpenSearch is suitable for various applications such as full-text search, real-time monitoring, and log analysis while enjoying its control, flexibility, and scalability features that unlocks your limits of creating different customized search solutions for your business.

OpenSearch is released under free to use license which attracts huge community to steer its development, adoption and success through code contributions improving features and capabilities, and documentation. AWS as a company, is known to be using OpenSearch as a backend for its “Amazon OpenSearch Service” service offering ( a managed service).

In this article we shall look at the steps of installing OpenSearch on Debian 12/11/10 Linux operating system. Perform this installation on a system that’s not running ElasticSearch or similar solution that could result in ports conflict. The installation process is similar to the one we did recently about OpenSearch installation on Ubuntu Linux.

Installation of OpenSearch on Debian 12/11/10

Here we provide you with the the steps needed to have a working installation of OpenSearch on Debian.

1. System updating

Ensure you’re performing the install on a fresh installation of Debian Linux system. But the system has to be updated prior to the other steps.

sudo apt update && sudo apt upgrade -y

Check if a reboot is needed after the upgrade. Sometimes this is the case.

[ -e /var/run/reboot-required ] && sudo reboot

2. Enable OpenSearch APT repository

All newest Debian packages of OpenSearch are available in OpenSearch APT repository installable using Advanced Package Tool (APT). The repository is not available by default and need to be added manually. It contains all the necessary dependencies and OpenSearch packages.

Let’s install packages that provide dependencies needed to enable the repository.

sudo apt update && sudo apt -y install gnupg2 lsb-release ca-certificates curl

Import OpenSearch GPG key that’s used in signing of OpenSearch packages for authenticity purposes.

curl -fsSL https://artifacts.opensearch.org/publickeys/opensearch.pgp|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/opensearch.gpg

Add OpenSearch repository to your Debian’s APT sources list.

echo "deb https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt stable main" | sudo tee /etc/apt/sources.list.d/opensearch-2.x.list

Now refresh the list of packages available in the OpenSearch repository we added.

sudo apt update

Use the APT package manager to install OpenSearch package on Debian.

sudo apt install vim opensearch

You can as well install a specific version of OpenSearch available in the APT repository.

sudo apt list -a opensearch
sudo apt install opensearch=<version>

Configure opensearch service to start automatically using systemd

 sudo systemctl daemon-reload
 sudo systemctl enable opensearch.service

3. Configure OpenSearch on Debian

Edit opensearch.yml file to adjust start configurations for OpenSearch.

sudo vim /etc/opensearch/opensearch.yml

Add the following lines:

# Bind OpenSearch to the correct network interface. Use 0.0.0.0
# to include all available interfaces or specify an IP address
# assigned to a specific interface.
network.host: 0.0.0.0

# Unless you have already configured a cluster, you should set
# discovery.type to single-node, or the bootstrap checks will
# fail when you try to start the service.
discovery.type: single-node

# If you previously disabled the Security plugin in opensearch.yml,
# be sure to re-enable it. Otherwise you can skip this setting.
plugins.security.disabled: true

You can also set Node name to use configured hostname in the system.

node.name: ${HOSTNAME}

Default name on index cluster can be sepcified.

cluster.name: mycluster

To specify initial and maximum JVM heap sizes, edit the following file.

sudo vim /etc/opensearch/jvm.options

Default setting.

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms1g
-Xmx1g

The values can be adjusted to match the RAM on your system.

When done with the changes you’ll need to restart OpenSearch service.

sudo systemctl restart opensearch

Checking service status.

$ systemctl status opensearch
● opensearch.service - OpenSearch
     Loaded: loaded (/lib/systemd/system/opensearch.service; enabled; preset: enabled)
     Active: active (running) since Wed 2023-11-29 09:52:26 UTC; 21s ago
       Docs: https://opensearch.org/
   Main PID: 3551 (java)
      Tasks: 69 (limit: 4531)
     Memory: 1.2G
        CPU: 41.549s
     CGroup: /system.slice/opensearch.service
             └─3551 /usr/share/opensearch/jdk/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.>
Nov 29 09:52:26 deb12 systemd[1]: Started opensearch.service - OpenSearch.

Test functionality of OpenSearch.

 curl -X GET http://localhost:9200

With plugins.security.disabled: set to false

$ curl -X GET https://localhost:9200 -u 'admin:admin' --insecure
{
  "name" : "deb12",
  "cluster_name" : "opensearch",
  "cluster_uuid" : "1C2PKCFKTRyeduMDE8UjjA",
  "version" : {
    "distribution" : "opensearch",
    "number" : "2.11.0",
    "build_type" : "deb",
    "build_hash" : "4dcad6dd1fd45b6bd91f041a041829c8687278fa",
    "build_date" : "2023-10-13T02:57:02.526977318Z",
    "build_snapshot" : false,
    "lucene_version" : "9.7.0",
    "minimum_wire_compatibility_version" : "7.10.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

4. Install OpenSearch Plugins

OpenSearch plugins are used to extend the functionality of OpenSearch search engine with extra features and capabilities. Plugins are available for enhancing monitoring, security, data visualization, e.t.c.

To list plugins that have already been installed, run:

# /usr/share/opensearch/bin/opensearch-plugin list
opensearch-alerting
opensearch-anomaly-detection
opensearch-asynchronous-search
opensearch-cross-cluster-replication
opensearch-custom-codecsIf that awesome I didn't
opensearch-geospatial
opensearch-index-management
opensearch-job-scheduler
opensearch-knn
opensearch-ml
opensearch-neural-search
opensearch-notifications
opensearch-notifications-core
opensearch-observability
opensearch-performance-analyzer
opensearch-reports-scheduler
opensearch-security
opensearch-security-analytics
opensearch-sql

Or query using curl without SSL:

curl -X GET http://localhost:9200/_cat/plugins?v

When plugins.security.disabled: set to false

$ curl -X GET https://localhost:9200/_cat/plugins?v -u 'admin:admin' --insecure
name  component                            version
deb12 opensearch-alerting                  2.11.0.0
deb12 opensearch-anomaly-detection         2.11.0.0
deb12 opensearch-asynchronous-search       2.11.0.0
deb12 opensearch-cross-cluster-replication 2.11.0.0
deb12 opensearch-custom-codecs             2.11.0.0
deb12 opensearch-geospatial                2.11.0.0
deb12 opensearch-index-management          2.11.0.0
deb12 opensearch-job-scheduler             2.11.0.0
deb12 opensearch-knn                       2.11.0.0
deb12 opensearch-ml                        2.11.0.0
deb12 opensearch-neural-search             2.11.0.0
deb12 opensearch-notifications             2.11.0.0
deb12 opensearch-notifications-core        2.11.0.0
deb12 opensearch-observability             2.11.0.0
deb12 opensearch-performance-analyzer      2.11.0.0
deb12 opensearch-reports-scheduler         2.11.0.0
deb12 opensearch-security                  2.11.0.0
deb12 opensearch-security-analytics        2.11.0.0
deb12 opensearch-sql                       2.11.0.0

Individual OpenSearch Plugins can be installed per need basis. For more information about available plugins, see Available plugins.

opensearch-plugin install <plugin-name>

Installing OpenSearch Dashboards

If you need OpenSearch Dashboards which is a user interface for visualizing OpenSearch data, see OpenSearch Dashboards official documentation page.

echo "deb https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.x/apt stable main" | sudo tee /etc/apt/sources.list.d/opensearch-dashboards-2.x.list
sudo apt update
sudo apt install opensearch-dashboards
sudo systemctl enable opensearch-dashboards
sudo systemctl start opensearch-dashboards
sudo systemctl status opensearch-dashboards

From a web browser, navigate to OpenSearch Dashboards. The default port is 5601 and server main IP address or localhost depending the the listen address.

opensearch dashboard

The default logins are:

  • Username admin
  • Password admin

Conclusion

In this blog post we’ve been successful in the installation and configuration of OpenSearch on a Debian Linux system. Deep customizations of OpenSearch is beyond the scope of this article. Read through OpenSearch documentation pages to learn more and be able to tweak and tune OpenSearch installation to accommodate varying business needs.

LEAVE A REPLY

Please enter your comment!
Please enter your name here