How to Install Elasticsearch on Ubuntu

install elasticsearch on ubuntu

Elasticsearch is a platform for distributed search and analysis of data in real-time.

This blog will guide you through installing Elasticsearch, configuring it for your use case, securing your installation, and beginning to work with your Elasticsearch server.

Why use Elasticsearch

1. Usability

2. Powerful Features

3. Scalability

Install Elasticsearch on Ubuntu

Step 1 – Install Java (Its necessary for dependencies)

sudo apt-get update
sudo apt install openjdk-8-jdk
java -version

Step 2 – Installing from the APT repository

sudo apt install apt-transport-https

Step 3 – Install and Download Elasticsearch

sudo 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

Step 4 – Install Elasticsearch

sudo apt-get update
sudo apt-get install elasticsearch

Step 5 – Start Elasticsearch Service

systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service
service elasticsearch status

Step 6 – Configure Elasticsearch

The default configuration doesn’t permit your machine to be accessed by other hosts. To allow remote access, use a text editor you want and open the elasticsearch.yml file
The elasticsearch.yml file provides configuration options for your cluster, node, paths, memory, network, discovery, and gateway. Most of these options are preconfigured in the file but you can change them according to your needs. For the purposes of our demonstration of a single-server configuration

sudo vim /etc/elasticsearch/elasticsearch.yml

Step 7 – ufw to Secure Elasticsearch

ufw allow 22
ufw enable
ufw status

Step 8 – Test Elasticsearch

curl localhost:9200

Install Magento 2.4 using CLI command

bin/magento setup:install –base-url=http://111.1111.4.135/m24 –db-host=localhost –db-name=m24 –db-user=root –db-password=password –admin-firstname=admin –admin-lastname=admin –[email protected] –admin-user=admin –admin-password=admin123 –language=en_US –currency=USD –timezone=America/Chicago –use-rewrites=1 –elasticsearch-host=localhost –elasticsearch-port=9200

Conclusion: Install Elasticsearch on Ubuntu and begun to use Elasticsearch.

Related blogs – What is composer

Like us on Facebook and Linkedin for more updates.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top