How to Install OpenSearch on Arch Linux

OpenSearch is a free and open-source search engine that provides fast and efficient searching capabilities. It is an enhanced version of Elasticsearch, which has been improved with features such as security, alerting, and performance optimization. This tutorial will guide you through the installation of OpenSearch on Arch Linux.

Prerequisites

Before we proceed with the installation, make sure that your Arch Linux system is up-to-date. You can update your system by running the following command:

sudo pacman -Syu

Step 1 — Install Java Runtime Environment (JRE)

OpenSearch requires Java to run. You can check whether Java is installed on your system by running the following command:

java -version

If Java is not installed, run the following command to install OpenJDK, which is the free and open version of the Java Development Kit:

sudo pacman -S jre-openjdk

Step 2 — Download and Install OpenSearch

The next step is to download and install OpenSearch. Follow these steps:

  1. Visit the OpenSearch official website.
  2. Choose the version you want to install.
  3. Right-click on the link for the Linux tar archive and copy the link address.
  4. Open a terminal and download the OpenSearch tarball using wget:
wget [link address]
  1. Extract the tarball by running the following command:
tar -xzf opensearch-[version]-linux-x64.tar.gz
  1. Move the extracted directory to /usr/share/
sudo mv opensearch-[version]-linux-x64 /usr/share/
  1. Create a symlink to /usr/bin/
sudo ln -s /usr/share/opensearch-[version]-linux-x64/bin/opensearch /usr/bin/

Step 3 — Start OpenSearch

You're now ready to start OpenSearch. To do so, run the following command:

sudo opensearch

If OpenSearch starts successfully, you should see output similar to the following:

[2021-08-12T08:21:19,053][INFO ][o.e.n.Node ] [node-1] open-search {choose-a-name}{unique-node-id}{your-node-name}{your-node-ipv4-or-ipv6}{your-node-id}
[2021-08-12T08:21:19,058][INFO ][o.e.n.Node ] [node-1] version[1.0]
[2021-08-12T08:21:19,058][INFO ][o.e.n.Node ] [node-1] JVM[OpenJDK 64-Bit Server VM 1.8.0_302][YOUR-JVM-ID]
[2021-08-12T08:21:19,058][INFO ][o.e.n.Node ] [node-1] OS[Linux 5.12.15-arch1-1][YOUR-OS-ID]
[2021-08-12T08:21:19,059][INFO ][o.e.n.Node ] [node-1] initializing ...
[2021-08-12T08:21:19,090][INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[/ (/dev/sda2)]], net usable_space [70.1gb], net total_space [147.7gb], types [ext4]

Step 4 — Verify OpenSearch is Running

To verify that OpenSearch is running, open a web browser and navigate to http://localhost:9200/. If OpenSearch is running, you should see a response similar to the following:

{
  "name" : "node-1",
  "cluster_name" : "open-search",
  "cluster_uuid" : "fopWmhLjSAiU0AFgGKwy8w",
  "version" : {
    "number" : "1.0",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "bec65e8bd51e23fecf7eb93a9f47cb5e68805c76",
    "build_date" : "2021-09-01T21:22:05.766101Z",
    "build_snapshot" : false,
    "lucene_version" : "8.9.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Conclusion

In this tutorial, we have gone through the installation of OpenSearch on Arch Linux. You can now start using OpenSearch to provide fast and efficient search functionality in your applications.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!