Menu Close

Setup latest Elastic Search and Kibana on CentOS7 in April 2022

Prerequisite

# change ip
sudo vi /etc/sysconfig/network-scripts/ifcfg-ens3

# change hostname
sudo vi /etc/hostname

# optional disable firewall
sudo systemctl disable firewalld –now

# install java
sudo yum install java-1.8.0-openjdk.x86_64 -y

Install elasticsearch

sudo rpm –import https://artifacts.elastic.co/GPG-KEY-elasticsearch

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

[elasticsearch]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md

sudo yum install –enablerepo=elasticsearch elasticsearch -y

sudo vi /etc/elasticsearch/elasticsearch.yml

node.name: "es1"
cluster.name: cluster1
script.allowed_types: none

By default, it is automatically configured based on available memory, but in case you want to specify a size, uncomment -xms and -xmx
sudo vi /etc/elasticsearch/jvm.options

-Xms4g
-Xmx4g

sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

# test
curl -X GET ‘http://localhost:9200’

setup kibana


sudo vi /etc/yum.repos.d/kibana.repo

[kibana-8.x]
name=Kibana repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md


sudo yum install kibana

bin/elasticsearch-create-enrollment-token -s kibana

sudo systemctl daemon-reload
sudo systemctl enable kibana.service
sudo systemctl restart kibana.service

Leave a Reply

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