How to install ElasticSearch 7 and 8 on Debian
Posted: Tue Jan 31, 2023 1:04 pm
Elasticsearch is a free and open-source distributed search and analytics engine that can handle all types of data, including text, numerical, geospatial, structured, and unstructured. It was developed based on Apache Lucene and was first introduced in 2010 by Elasticsearch N.V., now known as Elastic. With its user-friendly REST APIs, distributed architecture, speed, and scalability, Elasticsearch is the backbone of the Elastic Stack, a collection of open-source tools for data ingestion, enrichment, storage, analysis, and visualization. The Elastic Stack is commonly referred to as the ELK Stack (Elasticsearch, Logstash, and Kibana) and now includes a suite of lightweight data shippers called Beats for sending data to Elasticsearch.
In the following steps, we will guide you through the installation process of ElasticSearch 7 on a Debian server.
In your SSH, as root, run:
If you want to bind public IPv4:
In the following steps, we will guide you through the installation process of ElasticSearch 7 on a Debian server.
In your SSH, as root, run:
Code: Select all
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
apt-get update
apt-get install elasticsearch
# Now let's optionally limit ElasticSearch RAM usage to 2 GB :
echo "" >> /etc/elasticsearch/jvm.options
echo "-Xms2g" >> /etc/elasticsearch/jvm.options
echo "-Xmx2g" >> /etc/elasticsearch/jvm.options
systemctl enable elasticsearch.service
systemctl start elasticsearch.service
systemctl status elasticsearch.service
# Test it:
curl -X GET "http://localhost:9200/?pretty"
Code: Select all
echo "-Djava.net.preferIPv4Stack=true" >> /etc/elasticsearch/jvm.options
echo "" >> /etc/elasticsearch/elasticsearch.yml
echo "network.host: 0.0.0.0" >> /etc/elasticsearch/elasticsearch.yml
echo "cluster.initial_master_nodes: node-1" >> /etc/elasticsearch/elasticsearch.yml
systemctl restart elasticsearch.service