Elasticsearch is an open source search engine and analytics engine that allows you to store, search, and analyze data in real-time. Elasticsearch uses a distributed architecture and is built on Apache Lucene, and is characterized by high performance, scalability and usability. Elasticsearch is widely used in search, analytics, and log analysis.
It has the following capabilities:
The installation instructions for Elasticsearch will be roughly the same for different versions of Ubuntu. First, you will need to update the package list:
sudo apt update
Install the OpenJDK 11 package, which is required for Elasticsearch to work:
sudo apt install openjdk-11-jdk
Add the Elasticsearch key and repository to APT:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
Note: A different version of Elasticsearch may be specified in the URL instead of "7.x".
Update the package list and install Elasticsearch:
sudo apt update
sudo apt install elasticsearch
Configure Elasticsearch by editing the configuration file /etc/elasticsearch/elasticsearch/elasticsearch.yml
:
sudo nano /etc/elasticsearch/elasticsearch.yml
Let's look at some of the most important settings:
Start Elasticsearch and configure autorun:
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
Verify that Elasticsearch is running by sending a request to its API:
curl http://localhost:9200/
You should see a response with status and version information about Elasticsearch, such as:
{
"name" : "my-elasticsearch-node",
"cluster_name" : "my-elasticsearch-cluster",
"cluster_uuid" : "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"version" : {
"number" : "7.15.1",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "83c34f456ae29d60e94d886e455e6a3409bba9ed",
"build_date" : "2021-10-07T21:56:19.031608185Z",
"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"
}
Installing Elasticsearch on Ubuntu should complete successfully.