The Elasticsearch search and analytics engine is a highly scalable search and analytics tool that is compatible with open-source applications. The analysis of log and event data, full-text search, application performance monitoring, and business analytics are just some of the many applications that make use of it. It is also used for a wide range of additional purposes.
Prerequisites
Before installing Elasticsearch on the Ubuntu server will require the following specifications
Operating System and Version: Ubuntu 22.04
Minimum CPU: 2 CPU cores
Minimum RAM: 4 GB RAM
Should have root or sudo access
Installation steps
1. Import the Elasticsearch public GPG key into APT using the curl command below.
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elastic.gpg
2. Next add the Elastic source list to the sources.list.d directory
echo "deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
3. Update the package lists using below command
sudo apt update
4. Then using apt install command, install it on the server
sudo apt install elasticsearch
5. After the installation,Configure the Elasticsearch
To configure this edit the configuration file elasticsearch.yml located in the directory /etc/Elasticsearch using a text editor
sudo nano /etc/elasticsearch/elasticsearch.yml
The configuration file contains configuration settings such as cluster, node, paths, memory, and network. Elasticsearch listens on port 9200 by default, although it can be changed based on the requirements.
Then add the following lines in the configuration file. Instead of using localhost, you can specify an IP address to access
cluster.name: my-application
node.name: node-1
network.host: localhost
6. After configuring the configuration file start and enable the its service and check the status with systemctl command.
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
sudo systemctl status elasticsearch
Output should be as shown below.
7. Use the following command to test whether it is working correctly on the server
curl -X GET 'http://localhost:9200'
Output should be as shown below.
This will be configured and is working, as shown in the above output.
If you run into any issues or hiccups throughout to Install and Configure Elasticsearch on Ubuntu 22.04 , our Support Team members are here to help.