Install ElasticSearch 7.x on CentOS 7

This tutorial discusses how to install ElasticSearch 7.x on CentOS 7. Elasticsearch is an open source search and analysis engine that allows you to store, search, and analyze large amounts of data in real time. ElasticSearch provides support for millions of applications that rely on intensive search operations such as e-commerce platforms and big data applications.

As of this update, the latest version of ElasticSearch is 7. We will cover the minimum steps required to install ElasticSearch 7 on CentOS 7 Linux systems. let's start.

Step 1: Update CentOS 7 Linux

sudo yum -y update
sudo reboot

Step 2: Install Java on CentOS 7

ElasticSearch requires Java to be installed to run. The default Java that can be installed on CentOS 7 is Java 8. Below are the commands used for installation.

sudo yum -y install java-1.8.0-openjdk  java-1.8.0-openjdk-devel

Set Java home

cat <<EOF | sudo tee /etc/profile.d/java8.sh
export JAVA_HOME=/usr/lib/jvm/jre-openjdk
export PATH=\$PATH:\$JAVA_HOME/bin
export CLASSPATH=.:\$JAVA_HOME/jre/lib:\$JAVA_HOME/lib:\$JAVA_HOME/lib/tools.jar
EOF

Source created file to update your environment.

source /etc/profile.d/java8.sh

Step 3: Fill in ElasticSearch Yum library##

Add the repository for downloading the ElasticSearch 7 yum package to the CentOS 7 system.

cat <<EOF | sudo tee /etc/yum.repos.d/elasticsearch.repo
[ elasticsearch-7.x]
name=Elasticsearch repository for7.x packages
baseurl=https://artifacts.elastic.co/packages/oss-7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

If you want to install Elasticsearch 6, replace all matches of 7 with 6. After adding the repository, clear and update the YUM package index.

sudo yum clean all
sudo yum makecache

Step 4: Install ElasticSearch 7 on CentOS 7

Finally, install ElasticSearch 7.x on the CentOS 7 computer. Please note that we added an open source repository. Other commercial repositories can also be used.

sudo yum -y install elasticsearch-oss

Confirm to install ElasticSearch 7 on CentOS 7:

$ rpm -qi elasticsearch-oss
Name        : elasticsearch-oss
Epoch       :0
Version     :7.4.0
Release     :1
Architecture: x86_64
Install Date: Thu 17 Oct 201905:10:43 AM UTC
Group       : Application/Internet
Size        :395896718
License     : ASL 2.0
Signature   : RSA/SHA512, Fri 27 Sep 201910:40:01 AM UTC, Key ID d27d666cd88e42b4
Source RPM  : elasticsearch-oss-7.4.0-1-src.rpm
Build Date  : Fri 27 Sep 201908:49:06 AM UTC
Build Host  : packer-virtualbox-iso-1559162487
Relocations :/usr 
Packager    : Elasticsearch
Vendor      : Elasticsearch
URL         : https://www.elastic.co/
Summary     : Distributed RESTful search engine built for the cloud
Description :
Reference documentation can be found at
https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
and the 'Elasticsearch: The Definitive Guide' book can be found at
https://www.elastic.co/guide/en/elasticsearch/guide/current/index.html

Configure Java memory limit####

You can edit the file to set JVM options (such as memory limit): /etc/elasticsearch/jvm.options

The following example sets the initial/maximum value of the total heap space

$ sudo vi /etc/elasticsearch/jvm.options
.....- Xms1g
- Xmx1g

If the system has less memory, you can configure it to use small megabytes of memory.

- Xms256m
- Xmx512m

Automatically start the Elasticsearch service at boot:

sudo systemctl enable --now elasticsearch

Confirm that the service is running.

$ sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
 Loaded:loaded(/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
 Active:active(running) since Thu 2019-10-1705:16:00 UTC; 13s ago
  Docs:[http://www.elastic.co](http://www.elastic.co/)
 Main PID:8774(java)
 CGroup:/system.slice/elasticsearch.service
   └─8774/usr/share/elasticsearch/jdk/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75-XX:+UseCMSI...

Oct 1705:15:46 cent7.novalocal systemd[1]: Starting Elasticsearch...
Oct 1705:15:46 cent7.novalocal elasticsearch[8774]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in versio...elease.
Oct 1705:16:00 cent7.novalocal systemd[1]: Started Elasticsearch.
Hint: Some lines were ellipsized, use -l to show in full.

Check if you can connect to the Elasticsearch service

$ curl http://127.0.0.1:9200{"name":"cent7.novalocal","cluster_name":"elasticsearch","cluster_uuid":"SmGu9eXJRlGzxqEy2brGXQ","version":{"number":"7.4.0","build_flavor":"oss","build_type":"rpm","build_hash":"22e1767283e61a198cb4db791ea66e3f11ab9910","build_date":"2019-09-27T08:36:48.569419Z","build_snapshot":false,"lucene_version":"8.2.0","minimum_wire_compatibility_version":"6.8.0","minimum_index_compatibility_version":"6.0.0-beta1"},"tagline":"You Know, for Search"}

Step 5: Install Kibana on CentOS 7

Related Elasticsearch packages, such as Kibana, Logstash, etc. can be installed from the added repository. .

sudo yum install kibana-oss

After successful installation, configure Kibana:

$ sudo vi /etc/kibana/kibana.yml
server.host:"0.0.0.0"
server.name:"http://kibana.example.com"
elasticsearch.url:"http://localhost:9200"

Set the kibana service to start with the system:

sudo systemctl enable --now kibana

If you have an active firewall, you need to allow access to the Kibana port:

sudo firewall-cmd --add-port=5601/tcp --permanent
sudo firewall-cmd --reload

Access to open the kibana dashboard http://ip-address:5601

image

Step 6: Install Logstash on CentOS 7

Install Logstash with this command:

sudo yum install logstash

Recommended Posts

Install ElasticSearch 7.x on CentOS 7
Install Elasticsearch 6 on centos7
How to install Elasticsearch on CentOS 8
How to install Elasticsearch on CentOS 8
Install Docker on Centos7
install LNMP on centos7.4
Install Java on Centos 7
Nodejs install on centos7
Install FFmpeg on CentOS 8
Centos install elasticsearch tutorial
Install RabbitMQ on CentOS 7
Install Node.js on Centos
Maven install on centos7
Install MongoDB on CentOS 7
CentOS 6.X install VirtualBox-5.1
Install Surelog on CentOS8
Centos7 install mongodb 4.x
Openjdk install on centos7
Install Jenkins on centos7
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
install Docker on centos6.5
install oracle on centos
Install RabbitMQ on CentOS7
How to install and configure Elasticsearch on CentOS 7
Install mysql online on centos
Install MySQL 8.0.16 on Linux Centos
Install docker transfer on Centos7
Install docker on Centos system
install EPEL repo on centos
Centos6 install mysql 5.7.x series
Install Zabbix 3.4 based on CentOS 7
install virtualbox on centos server
Install Nginx server on CentOS 7
1.5 Install Centos7
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
Install JDK8 in rpm on CentOS7
How to install Memcached on CentOS 8
Install MATE or XFCE on CentOS 7
How to install R on CentOS 8
How to install Elasticsearch on Ubuntu 20.04
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
CentOS 6.x compile and install Nginx
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
Install MySQL on Linux CentOS7 (Windows)
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8