Install Elasticsearch on Linux

Posted by
  1. Install Elasticsearch on Linux
  2. Adding data to Elasticsearch

Welcome to the first post in the ELK Stack series. Heard a lot about the power of Elasticsearch / ELK Stack. Experimenting with Elasticsearch was high on my to-do list. My use-case for this experiment is to put stock market buy / sell signals in to it and trying to query the market sentiment.

NOTE: Just documenting my experience and learning process, do not mind the mistakes and poor language skills.

What is Elasticsearch?

Elasticsearch is a system which allows you to save huge amounts of unstructured data into data sets (indexes). These indexes document based, which make querying them lighting fast. The Elasticsearch core is running on top off Apache Lucene. Apache Lucene is a java based indexing engine. The power of Elasticsearch is the REST Api which processes JSON Data and returning JSON data for each fired query.

How to Install Elasticsearch on Ubuntu Linux?

For my project I use a single instance Linux Ubuntu 18.4 virtual machine. Getting started with the java default-jre installation.

Install Java on Ubuntu Linux

First of all, check if Java not already installed on you system.

If the output is looks like this “Command ‘java’ not found, but can be installed with”, install Java with the commands below.

Check your installation again.
Looks like mine is working.

get java version linux
java –version
Install Elasticsearch

Default Elasticsearch is not available in the official Ubuntu package repositories, so we need to add the source in our sources list. Before we do this we need to be sure that the right signing key is available on our system. Signing keys are used to protecting you from malicious packages which are spoofed.

Adding the signing key.

Adding Elasticsearch sources.

Update package sources and install the Elasticsearch package.

Configure Elasticsearch

The Elasticsearch configuration file is mostly located in /etc/elasticsearch with the filename elasticsearch.yml. In this configuration file you can tweak the entire system. For our case we only use a Elasticsearch stand-alone server without clustering or other fancy features. To make sure our instance is listening on all interfaces we change the network binding to “localhost” in the configuration.

To change this network binding:

Remove the mark before network.host and change it to localhost.
Save it and restart the service.

Test the installation with the following command:

Leave a Reply

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