Saturday, November 16, 2024
Google search engine
HomeGuest BlogsHow To Install Elasticsearch on CentOS 7 with Kibana

How To Install Elasticsearch on CentOS 7 with Kibana

Elasticsearch is a highly scalable open-source full-text search and analytics engine tool which helps you to store, search, and analyze big volumes of data in near real time. In this guide, I’ll show you the steps to install Elasticsearch 7/6 on CentOS 7 with Kibana to serve as Elastisearch Dashboard. Kibana lets you visualize your Elasticsearch data and navigate the Elastic Stack

How To Install Elasticsearch on CentOS 7

As Elasticsearch depends on Java, you need it installed on your machine prior to installing Elasticsearch 6 on CentOS 7.

sudo yum install java-11-openjdk-devel java-11-openjdk

Add Elasticsearch repository.

### Elasticsearch 7 ###
cat <<EOF | sudo tee /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/oss-7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

### Elasticsearch 6 ###
cat <<EOF | sudo tee /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/oss-6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

Elasticsearch repository is ready for use. You can install Elasticsearch using the command below:

sudo yum install elasticsearch-oss

You can set JVM options like memory limits by editing the file: /etc/elasticsearch/jvm.options

Start and enable elasticsearch service on boot:

sudo systemctl enable --now elasticsearch

Test to verify that it is working:

$ curl -XGET 'http://localhost:9200/_cat/master'
_9iJ9GPcR3CjwsZZPYzMbQ 127.0.0.1 127.0.0.1 _9iJ9GP

$ curl -XGET 'http://localhost:9200/_cat/nodes'
127.0.0.1 8 95 2 0.33 0.18 0.08 mdi * _9iJ9GP

Create a test index:

$ curl -X PUT "http://127.0.0.1:9200/mytest_index"
{"acknowledged":true,"shards_acknowledged":true,"index":"mytest_index"}

Install Kibana on CentOS 7

Install Kibana open source:

sudo yum install kibana-oss

After a successful installation, configure Kibana

$ sudo vi /etc/kibana/kibana.yml
server.host: "0.0.0.0"
server.name: "kibana.example.com"
elasticsearch.url: "http://localhost:9200"

Change other settings as desired then start Kibana service:

sudo systemctl enable --now kibana

Access http://ip-address:5601 to open Kibana Dashboard:

elasticsearch kibana centos7 min

If you have an active firewall, you’ll need to allow access to Kibana port:

sudo firewall-cmd --add-port=5601/tcp --permanent
sudo firewall-cmd --reload

Recommended book:

For Cluster setup, check:

RELATED ARTICLES

Most Popular

Recent Comments