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 β
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
Enjoyed every bit of your blog article.Really thank you!