Elasticsearch is a flexible, powerful, open-source and real-time search and analytics engine. Using a simple set of APIs, it provides the ability for full-text search. Elastic search is freely available under the Apache 2 license, which provides the most flexibility.
This tutorial will help you to install Elasticsearch on Ubuntu 20.04 LTS system.
Login to your Ubuntu system using sudo privileges. For the remote Ubuntu server using ssh to access it. Windows users can use putty or alternatives to log in to Ubuntu system.
Elasticsearch required Java run time installed on system. Ubuntu 20.04 system users, can run the following commands to install Java (OpenJDK 11):
class="terminal">sudo apt update
sudo apt install openjdk-11-jdk
After installation, check the Java version on your system:
java -version
openjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1) OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)
Also, make sure the JAVA_HOME environment variable is configured:
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
The Elasticsearch official team provides an apt repository to install Elasticsearch on Ubuntu Linux system. After install below package and import GPG key for Elasticsearch packages.
sudo apt install apt-transport-https
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Then configure the apt repository on your Debian system. The below command will add a repository to install latest Elasticsearch 6.X on your Ubuntu system.
add-apt-repository "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
After adding the repository to your system. Run the following commands to update cache and then install Elasticsearch packages on your system.
sudo apt update
sudo apt install elasticsearch
The above commands will install Elasticsearch including all the required dependencies on your system.
The Elasticsearch has been installed on your system. You can customize this by editing the Elasticsearch configuration file. Edit configuration file in your favorite text editor:
sudo nano /etc/elasticsearch/elasticsearch.yml
Then update the below basic configurations:
network.host: 0.0.0.0
cluster.name: myCluster1
node.name: "myNode1"
Save your file and close it.
Next, you need to enable Elasticsearch to start automatically on system boot. Also start service for the first time by running the following commands:
sudo /bin/systemctl enable elasticsearch
sudo /bin/systemctl start elasticsearch
You can use below commands to stop or restart Elasticsearch service from command line:
sudo systemctl stop elasticsearch
sudo systemctl restart elasticsearch
The Elasticsearch service is ready to use. You can test it using curl command-line utility. Run the simple GET command using curl to verify the setup. You will see the Elasticsearch cluster details with the version on your screen.
curl -X GET "http://localhost:9200/?pretty"
{ "name" : "myNode1", "cluster_name" : "myCluster1", "cluster_uuid" : "YLBEZHdqQ2W_gMiDUJXJyw", "version" : { "number" : "7.8.0", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "757314695644ea9a1dc2fecd26d1a43856725e65", "build_date" : "2020-06-14T19:35:50.234439Z", "build_snapshot" : false, "lucene_version" : "8.5.1", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" }
The above output shows the specifications of your elasticsearch server.
You can create a new bucket to your elasticsearch server by running the following command. Change mybucket with your bucket name:
curl -XPUT http://localhost:9200/mybucket
Output:
{"acknowledged":true}
In this tutorial, you have learned how to install Elasticsearch on Ubuntu 20.04 LTS system. Also, helps you to do basic configuration of Elasticsearch server.
The post How To Install Elasticsearch on Ubuntu 20.04 appeared first on TecAdmin.
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…
Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…