How to install Elasticsearch on Centos 7.4

To install Elasticsearch on CentOS 7.4

Elasticsearch is a real-time distributed and open source full-text search and analytics engine. It is used in Single Page Application (SPA) projects. Elasticsearch is open source developed in Java and used by many big organizations around the world. It is licensed under the Apache license version 2.0. In this brief tutorial, we will be explaining the basics of Elasticsearch and its features.

Install OpenJDK

Since Elasticsearch is written in the Java programming language, you need to install the latest OpenJDK by making use of the following command. By default, it is usually installed in CentOS 7.4, if not, then run the following command.

[root@linuxhelp ~]# yum install java-1.8.0-openjdk.x86_64 &ndash y

Once it is done, you shall check the Java version. If you get a proper output, it means that your OpenJDK is properly running.

[root@linuxhelp ~]# java -version
openjdk version " 1.8.0_151" 
OpenJDK Runtime Environment (build 1.8.0_151-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

You shall now download the latest and stable installation package from its official site as follows.

 [root@linuxhelp ~]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.1.rpm
--2017-12-15 07:38:55--  https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.1.rpm
Resolving artifacts.elastic.co (artifacts.elastic.co)... 54.235.82.130, 184.73.156.41, 54.243.108.41, ...
Connecting to artifacts.elastic.co (artifacts.elastic.co)|54.235.82.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27973688 (27M) [application/octet-stream]
Saving to: ‘ elasticsearch-6.0.1.rpm’ 

100%[============================================> ] 27,973,688  1008KB/s   in 57s    

2017-12-15 07:39:54 (476 KB/s) - ‘ elasticsearch-6.0.1.rpm’  saved [27973688/27973688]

Once it is downloaded, you shall proceed with its installation by triggering the following command.

[root@linuxhelp ~]# rpm -ivh elasticsearch-6.0.1.rpm
warning: elasticsearch-6.0.1.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
Preparing...                          ################################# [100%]
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Updating / installing...
   1:elasticsearch-0:6.0.1-1          ################################# [100%]
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
[root@linuxhelp ~]# systemctl daemon-reload
[root@linuxhelp ~]# systemctl start  elasticsearch 

Once all of it is done, you shall configure your Elasticsearch by making use of the following command.

[root@linuxhelp ~]# vim /etc/elasticsearch/elasticsearch.yml
network.host: 192.168.7.218
http.port: 9200


To check whether your elastic search service is LISTEN state, you shall run the following command.

[root@linuxhelp ~]# netstat &ndash plntu
EN      2058/rpcbind  
.
.
.
.      
tcp        0      0 ::ffff:127.0.0.1:9200       :::*                        LISTEN      3801/java    
.
.
.

Once it is done, you shall navigate to your browser and give http://192.168.7.218:9200 as the URL. If you get the following output, it means that your Elasticsearch is properly installed.

With this, this the installation of Elasticsearch comes to an end.


FAQ
Q
Why the need of Elasticsearch?
A
Elasticsearch is a real-time distributed and open source full-text search and analytics engine. It is used in Single Page Application (SPA) projects. Elasticsearch is open source developed in
Q
Can I use Elastic Cloud on platforms other than AWS?
A
Yes, you can create Elastic Cloud deployments on the Google Cloud Platform.
Q
Where is Elastic Cloud hosted?
A
We host our Elasticsearch clusters on Amazon EC2. We have availability zones in these regions: US East (N. Virginia), US West (N. California), US West-2 (Oregon), Europe (Ireland), Asia Pacif
Q
Which Elasticsearch version does Amazon Elasticsearch Service support?
A
Amazon Elasticsearch Service currently supports Elasticsearch versions 6.3, 6.2, 6.0, 5.6, 5.5, 5.3, 5.1, 2.3, and 1.5.
Q
What is an Amazon Elasticsearch domain?
A
Amazon Elasticsearch domains are Elasticsearch clusters created using the Amazon Elasticsearch Service console, CLI, or API. Each domain is an Elasticsearch cluster in the cloud with the computer and storage resources you specify. You can create and delete domains, define infrastructure attributes, and control access and security. You can run one or more Amazon Elasticsearch domains.