Sunday, October 30, 2016

Install Elasticsearch 5.0 on Centos 6.8

Steps to install Elastic 5.0 on Centos 6.8

Prerequisite

Elastic 5.0 will require java version 1.8.0_73 you can use either oracle JDK or OpenJDK, you can run this to install OpenJDK version
yum install java-1.8.0-openjdk

Install ElasticSearch

Download and Install Public Signing Key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Then use the following script to create a file called ELK5.repo on /etc/yum.repos.d and fill it with ELK 5.0 repository information
echo '[ELK-5.x]
name=ELK repository for 5.x packages (Elasticsearch, Kibana, Logstash)
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
' | sudo tee /etc/yum.repos.d/ELK5.repo
then continue to install elasticsearch
sudo yum install elasticsearch

Test Installation

Now you can start elasticsearch using
service elasticsearch start
and test it using
service elasticsearch status
the result would be like this if the elasticsearch server is successfully run
[root@localhost ~]# service elasticsearch status
elasticsearch (pid  1444) is running...
Other way to test it is by hitting the elasticsearch address, if succeed then elasticsearch will return the node information
[root@localhost ~]# curl localhost:9200
{
  "name" : "Up47emz",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "dj7FhxkeQsqP1Fr5ApP2vw",
  "version" : {
    "number" : "5.0.0",
    "build_hash" : "253032b",
    "build_date" : "2016-10-26T04:37:51.531Z",
    "build_snapshot" : false,
    "lucene_version" : "6.2.0"
  },
  "tagline" : "You Know, for Search"
}

No comments :

Post a Comment