Elasticsearch – Installation

Elasticsearch - Installation

Elasticsearch – Installation in this chapter, we will understand the installation procedure of Elasticsearch in detail. To install Elasticsearch on your local computer, you will have to follow the steps given below βˆ’

Step 1 βˆ’ Check the version of java installed on your computer. It should be java 7 or higher. You can check by doing the following βˆ’

In Windows Operating System (OS) (using command prompt)βˆ’

> java -version

In UNIX OS (Using Terminal) βˆ’

$ echo $JAVA_HOME

Step 2 βˆ’ Depending on your operating system, download Elasticsearch from www.elastic.co as mentioned below βˆ’

  • For windows OS, download ZIP file.
  • For UNIX OS, download TAR file.
  • For Debian OS, download DEB file.
  • For Red Hat and other Linux distributions, download RPN file.
  • APT and Yum utilities can also be used to install Elasticsearch in many Linux distributions.

Step3 βˆ’ Installation process for Elasticsearch is simple and is described below for different OS βˆ’

  • Windows OSβˆ’ Unzip the zip package and the Elasticsearch is installed.
  • UNIX OSβˆ’ Extract tar file in any location and the Elasticsearch is installed.
$wget
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch7.0.0-linux-x86_64.tar.gz

$tar -xzf elasticsearch-7.0.0-linux-x86_64.tar.gz
  • Using APT utility for Linux OSβˆ’ Download and install the Public Signing Key
$ wget -qo - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo
apt-key add -

Save the repository definition as shown below βˆ’

$ echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" |
sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

Run update using the following command βˆ’

$ sudo apt-get update

Now you can install by using the following command βˆ’

$ sudo apt-get install elasticsearch
  • Download and install the Debian package manually using the command given here βˆ’
$wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch7.0.0-amd64.deb
$sudo dpkg -i elasticsearch-7.0.0-amd64.deb0
  • Using YUM utility for Debian Linux OS
$ rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  • ADD the following text in the file with .repo suffix in your β€œ/etc/yum.repos.d/” directory. For example, elasticsearch.repo
elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
  • You can now install Elasticsearch by using the following command
sudo yum install elasticsearch

Step 4Β βˆ’ Go to the Elasticsearch home directory and inside the bin folder. Run the elasticsearch.bat file in the case of Windows or you can do the same using command prompt and through the terminal in case of UNIX rum Elasticsearch file.

In Windows

> cd elasticsearch-2.1.0/bin
> elasticsearch

In Linux

$ cd elasticsearch-2.1.0/bin
$ ./elasticsearch

NoteΒ βˆ’ In the case of windows, you might get an error stating JAVA_HOME is not set, please set it in environment variables to β€œC:\Program Files\Java\jre1.8.0_31” or the location where you installed java.

Step 5Β βˆ’ The default port for the Elasticsearch web interface is 9200 or you can change it by changing HTTP.port inside the elasticsearch.yml file present in the bin directory. You can check if the server is up and running by browsingΒ http://localhost:9200. It will return a JSON object, which contains the information about the installed Elasticsearch in the following manner βˆ’

{
   "name" : "Brain-Child",
   "cluster_name" : "elasticsearch", "version" : {
      "number" : "2.1.0",
      "build_hash" : "72cd1f1a3eee09505e036106146dc1949dc5dc87",
      "build_timestamp" : "2015-11-18T22:40:03Z",
      "build_snapshot" : false,
      "lucene_version" : "5.3.1"
   },
   "tagline" : "You Know, for Search"
}

Step 6 βˆ’ In this step, let us install Kibana. Follow the respective code given below for installing on Linux and Windows βˆ’

For Installation on Linux βˆ’

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.0.0-linuxx86_64.tar.gz

tar -xzf kibana-7.0.0-linux-x86_64.tar.gz

cd kibana-7.0.0-linux-x86_64/

./bin/kibana

For Installation on Windows βˆ’

Download Kibana for Windows from https://www.elastic.co/products/kibana. Once you click the link, you will find the home page as shown below βˆ’

Elasticsearch - Installation

Unzip and go to the Kibana home directory and then run it.

CD c:\kibana-7.0.0-windows-x86_64
.\bin\kibana.bat

Next Topic – Click Here

This Post Has One Comment

Leave a Reply