Snippets

GEORGE LIU elasticsearch 1.5 for CentOS 7 and CentOS 6.6

Created by GEORGE LIU
# instructions from official site at 
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-repositories.html
# http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html
# import public key for elasticsearch
############

# remove old elastistic search

yum -y remove elasticsearch 

# install new elasticsearch

rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch

# create file at /etc/yum.repos.d/elasticsearch.repo and add following contents

[elasticsearch-1.5]
name=Elasticsearch repository for 1.5.x packages
baseurl=http://packages.elasticsearch.org/elasticsearch/1.5/centos
gpgcheck=1
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
enabled=1

# check available package

yum list available --disablerepo=* --enablerepo=elasticsearch-1.5 -q

# install elasticsearch

yum -y install java-1.7.0-openjdk
yum -y install elasticsearch

then make sure to configure your elasticsearch like before if you had previously installed elasticsearch

##########################################
# ensure elasticsearch starts automatically + start service for first time

# for CentOS 7

systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service

# for CentOS 6.6

chkconfig elasticsearch on
service elasticsearch start

##########################################
# to stop

# for CentOS 7

systemctl stop elasticsearch.service

# for CentOS 6.6

service elasticsearch stop

##########################################
# to restart

# for CentOS 7

systemctl restart elasticsearch.service

# for CentOS 6.6

service elasticsearch restart

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.