Would you like to learn how to install Elasticsearch on a computer running Ubuntu Linux on the Amazon AWS cloud? In this tutorial, we are going to show you how to create a new account at Amazon AWS, how to create an Ubuntu virtual machine instance, and how to perform the Elasticsearch installation on a new virtual machine on the Amazon EC2 cloud.
• Ubuntu 20
• Ubuntu 18
• ElasticSearch 7.7.0
After finishing the installation, you need to use the Amazon Security Group feature to create firewall rules to allow the connection of the Elasticsearch clients.
Using the Amazon security group feature, create firewall rules to allow connections using the ports 9200 and 9300.
ElasticSearch Related Tutorial:
On this page, we offer quick access to a list of tutorials related to ElasticSearch installation.
Tutorial – How to Create a Key Pair
To access a Linux Virtual Machine on AWS, first, you need to create a private Key.
Open your browser, access the Amazon AWS website and enter your login information.
After a successful login, you will be sent to the AWS Dashboard.
Access the COMPUTE menu and select the EC2 option.
On the EC2 Dashboard, access the Network & Security menu and click on the Key Pairs option.
On the Key Pairs screen, click on the Create Key Pair button.
You will have to enter a name to the new Key Pair.
You will have to save locally your private key.
In our example, we created a key pair named TEST.
In our example, we saved a file named TEST.PEM.
Tutorial AWS EC2 – How to Create an Ubuntu virtual machine
On the EC2 Dashboard, access the Instances menu and click on the Instances option.
On the EC2 Instance screen, click on the Launch Instance button.
Now, it is time to select the desired Operational system image.
On the list presented, locate and select the Ubuntu Linux image.
As the second step, you will have to select the type of virtual machine that will run the Ubuntu Linux.
Basically, you will select the number of processors and the amount of RAM that you want.
If you do not want to specify the amount of hard disk available to this virtual machine, click on the Review and Launch button.
If you want to specify the amount of hard disk available to this virtual machine, click on the Configure instance detail button.
On the summary screen, click on the Launch button.
Select the Key pair authorized to connect to the new virtual machine and click on the Launch Instances.
In our example, the key pair named TEST was selected.
On the EC2 Dashboard, access the Instances menu and click on the Instances option.
As you can see a new virtual machine was created.
In our example, the virtual machine got the Dynamic IP address: 34.217.14.140
Tutorial AWS EC2 – How to Access the Ubuntu virtual machine
To access the Linux virtual machine you will have to download the following software:
• Putty
• PuttyGen
First, we need to convert the private key from the PEM format to the PPK format.
Open the PuttyGen software, access the Conversions menu and select the Import key.
After importing the PEM file, you need to set a password to protect your private key.
Click on the Save private key button to generate a file with the PPK extension.
In our example, a file named TEST.PPK was created.
Open the Putty software, select the SSH option and enter the username ubuntu@ followed by the IP address of the AWS virtual machine.
In our example, we used ubuntu@34.217.14.140.
Access the SSH authentication tab, click on the Browse button, locate the PPK file and click on the Open button.
An SSH connection will be started with your Ubuntu virtual machine.
Use the following command to become the root user on the Ubuntu virtual machine.
You have successfully created an Ubuntu virtual Machine on Amazon AWS.
Tutorial – ElasticSearch installation on the cloud
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.
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.
Start the ElasticSearch service.
Use the NETSTAT command to verify if the service is running on ports 9200 and 9300.
In our example, the ElasticSearch service is running on ports 9200 and 9300.
Verify the Elasticsearch server status.
Here is the expected command output.
Use the following comand to test your ElasticSearch installation.
Here is the command output:
Configure the ElasticSearch service to start during boot time.
Congratulations! You have finished the ElasticSearch installation on Ubuntu Linux.