Would you like to learn how to do an ElasticSearch cluster installation on Ubuntu Linux? In this tutorial, we are going to show you how to install an ElasticSearch cluster on a computer running Ubuntu Linux.
• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• ElasticSearch 7.7.0
In our example, The ElastiSearch node 01 IP address is 192.168.100.9.
In our example, The ElastiSearch node 02 IP address is 192.168.100.10.
ElasticSearch Related Tutorial:
On this page, we offer quick access to a list of tutorials related to ElasticSearch installation.
Tutorial ElasticSearch – Cluster installation
Use apt-get to install the required packages.
Download and install the ElasticSearch repository key.
Add the official ElasticSearch repository to your APT database
Update the APT-GET database and install the ElasticSearch package.
Repeat these steps on all nodes of the ElasticSearch cluster.
Tutorial ElasticSearch – Cluster Configuration on Node 01
Set a hostname using the hostnamectl command.
Stop the ElasticSearch service.
Edit the ElasticSearch configuration file named: elasticsearch.yml
Add the following lines at the end of the file.
Here is the file with our configuration.
In our example, we created and ElasticSearch cluster named: POWER-CLUSTER-01.
In our example, we set this node to be named as ElasticSearch-01.
In our example, we set the following master-eligible nodes: 192.168.100.9 and 192.168.100.10
Start the ElasticSearch service.
Verify the ElasticSearch cluster health status.
Here is the command output:
Congratulations! You have finished the configuration of the ElasticSearch cluster first node.
Tutorial ElasticSearch – Cluster Configuration on Node 02
Set a hostname using the hostnamectl command.
Stop the ElasticSearch service.
Edit the ElasticSearch configuration file named: elasticsearch.yml
Add the following lines at the end of the file.
Here is the file with our configuration.
In our example, we created and ElasticSearch cluster named: POWER-CLUSTER-01.
In our example, we set this node to be named as ElasticSearch-02.
In our example, we set the following master-eligible nodes: 192.168.100.9 and 192.168.100.10
Start the ElasticSearch service.
Verify the ElasticSearch cluster health status.
Here is the command output:
In our example, the ElasticSearch cluster status is green.
In our example, the ElasticSearch cluster number of nodes is 2.
Congratulations! You have finished the configuration of the ElasticSearch cluster.
Tutorial ElasticSearch – Testing the Cluster
Create an ElasticSearch index on the first node of the cluster.
Add some information to this ElasticSearch index.
List the information inside this ElasticSearch index.
Here is the command output:
Request the same information from the second ElasticSearch node.
Here is the command output:
Both ElasticSearch nodes have the same information.