ElasticSearch Cluster, Logstash And Kibana (ELK5) installation on Linux CentOS 7 - Logstash Installation - Page 4

Install logstash 5



  1. Download and install the public signing key (ignore this if you have imported the same key during other package installation):
# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  1. Add below lines to sources.list to /etc/yum.repos.d/logstash.repo:
[logstash-5.x]
name=Elastic repository for 5.x packages
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
  1. Install logstash:
# yum -y install logstash
  1. Set logstash to start automatically using systemd:
# systemctl daemon-reload && systemctl enable logstash.service
  1. Stop and start logstash:

# systemctl stop logstash.service && sudo systemctl start logstash.service


Prepared by :
Hisham Aderis ([email protected])
Harisfazillah Jamel ([email protected])


Date : 2 Dec 2016
Last updated: 31 August 2017

ElasticSearch Cluster, Logstash And Kibana (ELK5) installation on Linux CentOS 7 - ElasticSearch Installation - Page 3

Install elasticsearch 5

  1. Add key:
# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
  1. Add elasticsearch.repo. Using text editor, add below lines to /etc/yum.repos.d/elasticsearch.repo:
[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
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
  1. Install elasticsearch:
# yum install elasticsearch -y
  1. Set elasticsearch to start automatically using systemd:
# systemctl daemon-reload && systemctl enable elasticsearch.service
  1. Set hostname to be resolved locally using /etc/hosts. Use DNS if you have one:
# cat /etc/hosts
192.168.10.10 node1
  1. Bind hostname to elasticsearch, by uncommenting below line in /etc/elasticsearch/elasticsearch.yml. The node name can be anything to your liking, but must be similar to the one set in step 5:
network.host: node1
  1. Set bootstrap memory lock to be true in /etc/elasticsearch/elasticsearch.yml
bootstrap.memory_lock: true
  1. Set maximum number of memory bytes that may be locked into RAM in /usr/lib/systemd/system/elasticsearch.service, by uncommenting below line
LimitMEMLOCK=infinity
  1. Reload systemctl
# systemctl daemon-reload
  1. Set java heap size for elasticsearch to use in /etc/sysconfig/elasticsearch(rule of thumb, use ½ of your physical memory. In this example 2GB for system with 4GB):
ES_JAVA_OPTS="-Xms2g -Xmx2g"
MAX_OPEN_FILES=65536
MAX_LOCKED_MEMORY=unlimited
  1. The config file will look like below:
# grep -v ^# /etc/sysconfig/elasticsearch | grep -v ^$
ES_JAVA_OPTS="-Xms2g -Xmx2g"
MAX_OPEN_FILES=65536
MAX_LOCKED_MEMORY=unlimited
  1. Set file limits for elasticsearch in /etc/security/limits.conf (this change needs reboot for the change to take effect):
elasticsearch - nofile 65535
elasticsearch - memlock unlimited
  1. The config file will look like below:
# grep -v ^# /etc/security/limits.conf | grep -v ^$ | tail -5
elasticsearch - nofile 65535
elasticsearch - memlock unlimited
  1. Reboot the machine
# reboot
  1. Stop & start elasticsearch:
# systemctl stop elasticsearch.service && systemctl start elasticsearch.service
  1. Test whether elasticsearch is running, output should be something like below:
# curl -XGET node1:9200/?pretty
{
"name" : "Cp8oag6",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA",
"version" : {
"number" : "5.0.0",
"build_hash" : "f27399d",
"build_date" : "2016-03-30T09:51:41.449Z",
"build_snapshot" : false,
"lucene_version" : "6.2.0"
},
"tagline" : "You Know, for Search"

}

Prepared by :
Hisham Aderis ([email protected])
Harisfazillah Jamel ([email protected])


Date : 2 Dec 2016
Last updated: 31 August 2017

ElasticSearch Cluster, Logstash And Kibana (ELK5) installation on Linux CentOS 7 - Java Installation - Page 2

Install Java version 8

You can either use java 8 from oracle, or java 8 openjdk version

Install Java version 8 (from oracle)

  1. Download the rpm file:
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm"
  1. Install java:
# yum -y localinstall jdk-8u112-linux-x64.rpm
  1. Check java version to verify java is installed properly:
# java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

Install Java version 8 (openjdk)

  1. Install java version 8:
# yum install java
  1. Check java version to verify java is installed properly:
# java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

Prepared by :
Hisham Aderis ([email protected])
Harisfazillah Jamel ([email protected])


Date : 2 Dec 2016

Last updated: 31 August 2017

ElasticSearch Cluster, Logstash & Kibana (ELK5) Installation On Linux CentOS 7 - Main Page

ElasticSearch Cluster, Logstash & Kibana (ELK5) installation on Linux CentOS 7

Prepared by :
Hisham Aderis ([email protected])
Harisfazillah Jamel ([email protected])


Date : 2 Dec 2016

Last updated: 31 August 2017

Click label ELK for more tutorial about ElasticSearch, Logstash And Kibana

Popular Posts

Labels

64bit Activity Adempire advocate Akta Apache ASAS Azam backup backuppc Bash Beowulf Big Data Broadband Budget Centos Cinta Cluster CMS cmsfornerd Company Complain computer Computer Operation Conference Contest Data Centre Operation DBmail Digg Digital Certification Discussion Group Django DNS Docker Domain Duit Online Economy Elastic Stack Elasticsearch ELK email email server English Evangelist Events Family Tree Fedora File System Firefox Foss FOSS.my FreeBSD FTX Gesaan Gluster Gmail Godaddy.com Google Google App GTUG Hacking Hadoop hafnie Harisfazillah Jamel horde HP-UX hwclock IBM ICT Service Delivery and Operation Indonesia Internet Internet Tools Itanium Jabatan IT Negara Jaring Java Javascript Jepun Jiwang Joke Joomla K3S K3Sup Kernel Kesihatan Kibana KOSTEM Kubernetes ldap Linux Linux Counter linuxmalaysia Logstash Love Mailman MailScanner Mailwatch Malay Malaysia MAMPU MDeC meetup Melaka Melayu Merdeka Microsoft Migration mirror sites Money Online Monitor MOSC 2010 MOSC2010 mosc2011 MOSC2013 MOSCMY MOSCMY2014 MOSCMY2015 Mozilla MPI MSC Malaysia MSC Malaysia OSCONF MSCOSCONF My Love MyGOSSCON MyMeeting Mypenguin99 mysql Nagios NagiosQL Negaraku nss_ldap ntp OBW2014 Open Office Open Source openldap Openoffice.org OpenStack Opera OS2 OS400 OSCC OSCC MAMPU osdc.my OSS OSS Policy OWASP Parallel Computing People Power Personal Petition PGP PHP Pligg Podman Politik Postfix Postgresql Programming Proxmox Python q1moscmy2015 Questionnaires Research Research tools RPM SASSIAN Sassian 85-89 Sassians 85-89 SCO Security Sekolah Sekolah Alam Shah Shell script Software License Solaris SongketMail SongketMailFilter sourceforge spam spamassassin Spoof Survey SVR4 System Tools Technorati Terjemahan Terminal TMnet Tor Training translation Treasury Malaysia Trend Micro Twitter Ubuntu Unix Virtualization VMS VOIP Wang Web Server Windows Zimbra
 

LinuxMalaysia Mastodon