Insight: Tutorial To Install Elasticsearch on CentOS 8
Elasticsearch, developed in Java is a search engine based on the Lucene library that provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.
In this tutorial post, we will show you the method to install Elastisearch on CentOS 8 Linux operating system.
Tutorial To Install Elasticsearch on CentOS 8
Run the following as root to install the OpenJDK package at first:
sudo dnf install java-11-openjdk-devel
As elasticsearch is not available in the standard CentOS 8 repositories, you need to install it from the Elasticsearch RPM repository.
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Now, Open your text editor and create the repository file the /etc/yum.repos.d/ directory:
sudo nano /etc/yum.repos.d/elasticsearch.repo
Paste the following content:
[elasticsearch-7.x] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-mdSave the file and close your text editor.
Now that the repository is enabled. You can easily install the Elasticsearch by typing the following command:
sudo dnf install elasticsearch
Now start, and enable the service:
sudo systemctl enable elasticsearch.service --now
If you want to verify that Elasticsearch is running or not, you can run the command by using
curl to send an HTTP request to port 9200 on localhost:
curl -X GET "localhost:9200/"