How to Install Elasticsearch on Void Linux

Elasticsearch is a powerful open-source search and analytics engine that helps you to search, analyze, and visualize large amounts of data in real-time. In this tutorial, we'll guide you through the process of installing Elasticsearch on Void Linux.

Prerequisites

Before installing Elasticsearch on your Void Linux environment, you need to have the following requirements satisfied:

Step 1: Add Elasticsearch Repository

First, we have to add Elasticsearch's official repository to our Void Linux system. To do this, run the following command in the terminal:

echo "https://packages.elastic.co/GPG-KEY-elasticsearch" | sudo xbps-install -S gnupg curl
sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
sudo bash -c 'echo "[elasticsearch-7.x]\nname=Elasticsearch repository for 7.x packages\nbaseurl=https://artifacts.elastic.co/packages/7.x/yum\ngpgcheck=1\ngpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch\nenabled=1" > /etc/xbps.d/elasticsearch.repo'

Step 2: Install Elasticsearch

Next, we'll install Elasticsearch:

sudo xbps-install elasticsearch

Step 3: Starting and enabling Elasticsearch

Once the installation process is complete, we have to start and enable Elasticsearch so that it can run as a background service.

Use the following command to start the Elasticsearch service:

sudo ln -s /etc/sv/elasticsearch /var/service/

You can verify whether the Elasticsearch is running or not using the following command:

sv status elasticsearch

You should see something like this:

log: /var/log/service/elasticsearch: current -> /run/elasticsearch-2022-10-20-04-23-15/log, previous -> /var/log/service/elasticsearch
supervisor: ok: run: 1s, normally up

Step 4: Verify Elasticsearch installation

To confirm that Elasticsearch is installed properly on your system, you can run the following command in the terminal:

curl -X GET http://localhost:9200

If everything is set up correctly, you should see the following output:

{
  "name" : "node-1",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "c8SrFlZGQMSnboP6TBNz6Q",
  "version" : {
    "number" : "7.15.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "79d65f6e357953a5b3cbcc5e2c7c21073d89aa29",
    "build_date" : "2022-10-13T00:23:54.524573064Z",
    "build_snapshot" : false,
    "lucene_version" : "8.10.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Conclusion

That's it! You have successfully installed Elasticsearch on your Void Linux system. You can now use Elasticsearch to search, analyze, and visualize your data.

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!