Install elasticsearch on CentOS 7

To install elasticsearch, first install java

yum -y install java-1.8.0-openjdk

Import key

rpm --import

Create file

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

Paste following

name=Elasticsearch repository for 7.x packages

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          :::*                    LISTEN      1289/java           
tcp6       0      0 ::1:9200                :::*                    LISTEN      1289/java           
tcp6       0      0          :::*                    LISTEN      1289/java           
tcp6       0      0 ::1:9300                :::*                    LISTEN      1289/java           
[root@server ~]# 

If you get error starting elasticsearch, check Elasticsearch failed to start on CentOS 7

If you have a previous installation, make sure you delete left over files before you install differnt version of elasticsearch. I removed following files/folders when i had to downgrade elasticsearch.


See elasticsearch

Need help with Linux Server or WordPress? We can help!

Leave a Reply

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