How to Install Elasticsearch on Ubuntu Server Latest
Introduction
Elasticsearch is an open-source, distributed search and analytics engine. It is highly scalable and can be used to search, store, and analyze large amounts of data. In this tutorial, we will learn how to install Elasticsearch on Ubuntu Server Latest.
Prerequisites
To follow along with this tutorial, you will need:
- A server running Ubuntu Server Latest.
- A user account with sudo privileges.
Step 1: Update Your System
Before we begin, let's update our Ubuntu system to the latest version.
sudo apt update
sudo apt upgrade
Step 2: Install Java
Elasticsearch requires Java to run. We will install the OpenJDK 8 package.
sudo apt-get install openjdk-8-jre-headless
Step 3: Install Elasticsearch
Elasticsearch can be installed using the Debian package provided by Elasticsearch.
sudo apt-get install apt-transport-https
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 -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update
sudo apt-get install elasticsearch
Step 4: Start and Enable Elasticsearch
Once the installation is complete, start Elasticsearch using the following command:
sudo systemctl start elasticsearch.service
To ensure that Elasticsearch starts on boot, run:
sudo systemctl enable elasticsearch.service
Check the status of Elasticsearch to make sure it is running.
sudo systemctl status elasticsearch.service
Step 5: Verify Elasticsearch Installation
To verify that Elasticsearch is installed and running correctly, use the curl command to check the Elasticsearch version.
curl -X GET http://localhost:9200
The output should be similar to the following:
{
"name" : "Gandalf Marvel",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "W57zE6vVRXK-E5k6l5UW2Q",
"version" : {
"number" : "7.10.2",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "747e1cc71def077253878a59143c1f785afa92b9",
"build_date" : "2021-01-13T00:42:12.435326Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
The version number should match the Elasticsearch version you installed.
Conclusion
In this tutorial, we learned how to install Elasticsearch on Ubuntu Server Latest. With Elasticsearch installed, you can begin to create indexes and start searching and analyzing large amounts of data.