Elasticsearch is a full-featured open-source search engine developed in Java. Takes unstructured data from various sources and stores it in a complex format that is highly optimized for text search. In this article, we are going to teach you How to Install Elasticsearch on Ubuntu 21.04. You can visit the packages available in Eldernode if you wish to purchase an Ubuntu VPS server.
How to Install Elasticsearch on Ubuntu 21.04
What is Elasticsearch?
Elasticsearch is a product of a company called Elastic, which was founded in 2012. Elasticsearch uses Lucene Apache at its core for indexing and searching. Lucene is a library that is really complicated to work with; But don’t worry, Elasticsearch eliminates all the hassle by providing API usability.
Using Elasticsearch, large volumes of data can be stored and analyzed quickly and efficiently. This is especially useful when dealing with semi-structured natural language data.
Elasticsearch scalability and speed are high and can be used for:
_ Search the app
_ Website Search
_ Organizational search
_ Analysis of input information
_ Check program performance
_ Analysis and visualization of data
_ Security analysis
_ Business analysis
Prerequisites to Install Elasticsearch on Ubuntu 21.04
In this section, we want to show you the prerequisites to install Elasticsearch on Ubuntu 21.04. To do this, just follow the steps below.
You need to update the packages index. Then you need to install OpenJDK 8:
apt install openjdk-8-jdk
You can now check the JAVA status using the following command:
Install Elasticsearch on Ubuntu 21.04 | Ubuntu 20.04
Now we want to teach you how to install Elasticsearch on Ubuntu 21.04. Just follow the steps below correctly and in order.
The first step is to import the GPG key for Elasticsearch packages using the following command:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
Then you need to add Elasticsearch repository to the system using the following command:
sh -c 'echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" > /etc/apt/sources.list.d/elastic-6.x.list'
After completing the above steps, you must first update the cache using the following commands. Then install Elasticsearch packages on the system:
apt install elasticsearch
Finally, you can use the following commands Start and enable the Elasticsearch service:
systemctl start elasticsearch.service
systemctl enable elasticsearch.service
How to Configure Elasticsearch on Ubuntu 21.04 | Ubuntu 20.04
In this section, we want to examine the Elasticsearch configuration. To do this, just open the configuration file using one of the text editors you want:
Now you need to look in the linear configuration file that contains network.host. Then uncomment it and change its value to 0.0.0.0. Note that at this point you need to set the network host to 0.0.0.0. To do this, use the following command:
The interesting thing to know is that if you want this configuration on your device to be private or local, you have to set network.host to 127.0.0.1.
After you have made the said changes to the configuration file, you can now save the file and exit it. Now you need to restart Elasticsearch using the following command to apply the changes:
systemctl restart elasticsearch
There are many benefits to using Elasticsearch. These benefits include scalability, speed, Elasticsearch API use, multilanguage, document optimization, autocomplete, and free schema. In this article, we tried to teach you step by step how to install Elasticsearch on Ubuntu 21.04.