Install elasticsearch on CentOS 7

To install elasticsearch, first install java

yum -y install java-1.8.0-openjdk

Import key

rpm –import https://artifacts.elastic.co/GPG-KEY-elasticsearch

Create file

vi /etc/yum.repos.d/elasticsearch.repo

Paste following

[elasticsearch]
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=0
autorefresh=1
type=rpm-md

Install elasticsearch

yum install –enablerepo=elasticsearch elasticsearch

Set elastic search to start on boot

systemctl enable elasticsearch

To start/stop/status

systemctl stop elasticsearch.service
systemctl start elasticsearch.service
systemctl status elasticsearch.service

To see logs

tail -f /var/log/elasticsearch/elasticsearch.log

ElasticSearch runs on port 9200

[root@server ~]# netstat -lntp | grep java
tcp6 0 0 127.0.0.1:9200 :::* LISTEN 1289/java
tcp6 0 0 ::1:9200 :::* LISTEN 1289/java
tcp6 0 0 127.0.0.1:9300 :::* LISTEN 1289/java
tcp6 0 0 ::1:9300 :::* LISTEN 1289/java
[root@server ~]#

Leave a Comment

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

Hire a server Expert to resolve the issue Now.

Hire a server Expert to resolve the issue Now.

Resolve this issue in just 5$ from https://serverexpert.io

 

You have Successfully Subscribed!

Open chat