Sunday, October 30, 2016

Install Elasticsearch 5.0 on Ubuntu 16.04

Steps to install Elastic 5.0 on Ubuntu 16.04

Prerequisite

Elastic 5.0 will require java version 1.8.0_73 you can use either oracle JDK or OpenJDK, run this to install OpenJDK version
sudo apt-get install openjdk-8-jre-headless

Additionally, you may need to install / upgrade apt-transport-https just to be sure, run this to do that
sudo apt-get install apt-transport-https

Install ElasticSearch

first of all you need to download elastic key
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
and then save repository definition to elastic 5.0 stable version
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
then continue to install elasticsearch
sudo apt-get update && sudo apt-get install elasticsearch

Test Installation

Now you can start elasticsearch using
sudo service elasticsearch start
and test it using
sudo service elasticsearch status
the result would be like this if the elasticsearch server is successfully run
test@testELK:~$ sudo service elasticsearch status
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: active (running) since Sun 2016-10-30 10:32:45 WIB; 5s ago
Docs: http://www.elastic.co
Process: 5116 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 5119 (java)
Tasks: 15
Memory: 2.1G
CPU: 5.107s
CGroup: /system.slice/elasticsearch.service
└─5119 /usr/bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiat

Other way to test it is by hitting the elasticsearch address, if succeed then elasticsearch will return the node information
test@testELK:~$curl localhost:9200
{
"name" : "45URyFc",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "nBsuqyqDRpW_-ECpY3hk8w",
"version" : {
"number" : "5.0.0",
"build_hash" : "253032b",
"build_date" : "2016-10-26T05:11:34.737Z",
"build_snapshot" : false,
"lucene_version" : "6.2.0"
},
"tagline" : "You Know, for Search"
}

No comments :

Post a Comment