Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Elasticsearch on Debian 10 - DesignLinux

Jul 17 2020
designlinux 0 Comments
How to Install Elasticsearch on Debian 10

Elasticsearch is a powerful open-source analytics and full-text search engine. It provides a distributed, multitenant-capable architecture which enables you to store, search and analyze large volumes of data faster. Elastic search is freely available under the Apache 2 license, which provides the most flexibility. In this tutorial we will show you how to install Elasticsearch on Debian 10.

Install Elasticsearch on Debian#

First, you should login to your Debian system using sudo privileged user or root account. Perform the following steps:

1. Installing Java#

Java is the primary requirement to run Elasticsearch on any system, so the first step is to install Java.

Execute the following command to install the OpenJDK package:

sudo apt install default-jdk

Verify the Java installation by checking the Java version:

java -version

It will show the output like below:

openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Debian-1deb10u1, mixed mode, sharing)

2. Installing Elasticsearch#

The standard Debian 10 repositories does not includes Elasticsearch package, so we will install it from the Elasticsearch APT repository.

Import the repository’s public key using the following wget command:

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

It should print OK as an output, that means the key has been successfully imported, and packages from this repository will be considered trusted.

Run the following command to add the Elasticsearch repository to the system:

sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'

Next, update the packages index and install the Elasticsearch engine:

sudo apt update
sudo apt install elasticsearch

After completion of the process, start, and enable the service:

sudo systemctl enable elasticsearch.service --now

3. Configuring Elasticsearch#

Configuration files for Elasticsearch are located in /etc/elasticsearch and Java start-up options can be configured in the /etc/default/elasticsearch file.

By default, Elasticsearch is configured to listen on localhost only. There is no authentication layer in Elasticsearch, so it can be accessed by anyone who can access the HTTP API. If you want to allow remote access to your Elasticsearch server, you will need to configure your firewall and allow access to the Elasticsearch port 9200 only from trusted clients.

For instance, if your system has UFW and you want to allow connections only from 192.168.123.45, run the following command:

sudo ufw allow from 192.168.123.45 to any port 9200

Next, you have to edit the Elasticsearch configuration and allow Elasticsearch to listen for external connections.

Open the elasticsearch.yml configuration file:

sudo nano /etc/elasticsearch/elasticsearch.yml

Find the line that contains network.host, uncomment and change the value to 0.0.0.0:

network.host: 0.0.0.0

Restart the Elasticsearch service for the changes to take effect:

sudo systemctl restart elasticsearch

It’s done. You can now connect to the Elasticsearch server from the remote location.

4. Test Elasticsearch Setup#

The Elasticsearch service is ready to use. You can test it using curl command-line utility. To verify, use curl to send an HTTP request to port 9200 on localhost:

curl -X GET "http://localhost:9200/?pretty"
{
  "name" : "debian10.localdomain",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "yCOOHdvYR8mHRs5mNXQdDQ",
  "version" : {
    "number" : "7.8.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "aa751e09be0a5072e8570670309b1f12348f023b",
    "build_date" : "2020-02-29T00:15:25.529771Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Conclusion#

This tutorial shown you how to install Elasticsearch on Debian 10. To get more details about Elasticsearch visit the official documentation page.

If you face any problem or having a feedback, feel free to leave a comment below.

Related

Tags: database, debian, elasticsearch, java

How to Install Jenkins on Ubuntu 20.04

Prev Post

How to Check Memory Usage in Linux

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 519
  • 1,055,291

DesignLinux.com © All rights reserved

Go to mobile version