Cheap VPS host selection
Provide server host evaluation information

How to install Elasticsearch on Ubuntu server system

Elasticsearch is an open source distributed search and analysis engine developed on the basis of Apache Lucene. It is usually used for applications with advanced search requirements, such as large and medium-sized e-commerce websites. This tutorial mainly introduces how to install and configure Elastic search on the Ubuntu server.

Deploy an Ubuntu server (this article takes the RAKsmart US server, and the operating system is Ubuntu 20.04 LTS as an example), and then use SSH tools to connect to the server (the login credentials can be viewed in the email filled in when registering the RAKsmart account, or directly from the background management page).

After successfully logging in to the Ubuntu server, run the following command to update the package index and install the dependencies necessary to add a new HTTPS repository. You do not need to install Java separately here, because the Elastic search bundle comes with a bundled version of OpenJKD.

sudo apt update sudo

apt install apt-transport-https ca-certificates wget

Then, use the following command to import the GPG key for the repository.

wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add –

If the output result is OK, it means that the GPG key has been imported. Next, run the following command to add the Elastic search repository to the system.

sudo sh -c ‘echo “deb https://artifacts.elastic.co/packages/7.x/apt stable main” >

When you are finished, you can easily install Elasticsearch by entering the following.

sudo apt update sudo apt install elasticsearch

The Elasticsearch service generally does not start automatically. If you want to enable it, run the following command.

sudo systemctl enable –now elasticsearch.service

You can use curl to send an HTTP request to port 9200 on localhost, and ensure that Elasticsearch is running by entering the following command.

curl -X GET “localhost:9200/”

If nothing unexpected, you will see the output information with the Elastic search version number. To view the Elasticsearch service record information, run the following command.

sudo journalctl -u elasticsearch

The address of the Elasticsearch configuration file is/etc/lasticsearch, and the data itself is located in the/var/lib/lasticsearch directory. Java startup options can be configured in the/etc/default/lasticsearch file.

By default, Elasticsearch is configured to listen on the localhost. Therefore, if you are setting up a single node cluster and the client connected to the database is also running on the same host, you do not need to change the default configuration file.

Through the above steps, you can successfully install and configure Elastic search on the Ubuntu server.

Do not reprint without permission: Cheap VPS evaluation » How to install Elasticsearch on Ubuntu server system