---
title: "Kibana, the elastic stack's central management"
url: "https://vanducng.dev/2019/12/20/Kibana-the-elastic-stack-s-central-management/"
date: "2019-12-20"
categories: ["Data"]
tags: ["elasticsearch"]
---

# Kibana, the elastic stack's central management

<p align="center">
	<image src="/media/gifs/kibana-quick-tour.gif" class="img-reponsive" alt="kibana" width="100%" />
</p>

Kibana is part of ELK stack to visualize data from elasticsearch. Further than that, Kibana is equipped with many features and plug-ins such as elastic nodes & infrastructure monitoring, user roles or life cycle management and query experiment elasticsearch database.   

Spend sometime with the demo Kibana page to feel it. [Click Here.](https://demo.elastic.co/app/kibana#/home?_g=())

## Getting started
### Basic setup
The following steps are applicable for CentOS 7 which is supposed to be similar to other Linux distro. 

Follow the direction from [official guide](https://www.elastic.co/guide/en/kibana/6.8/rpm.html) to install Kibana.
```bash
    rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    wget https://artifacts.elastic.co/downloads/kibana/kibana-6.8.5-x86_64.rpm
    shasum -a 512 kibana-6.8.5-x86_64.rpm
    sudo rpm --install kibana-6.8.5-x86_64.rpm
```

Start or stop Kibana service by following commands:
```bash
systemctl start kibana
systemctl stop kibana stop
```

Similarly to ElasticSearch, Kibana configuration file can be modified from **/etc/kibana/kibana.yml**. The default port is 5601, the elastic host is installed in same server at port 9200, then uncomment it as **localhost:9200**. At server.host, make it as '0.0.0.0' so Kibana can listen on any IP address instead of localhost. 
```bash
nano /etc/kibana/kibana.yml
```
<p align="center">
		<image src="/media/images/kibana-yml.png" width="100%"  />
</p>

Restart the Kibaba service to get the setting updated 
```bash
service kibana restart
netstat -tulpn|grep node
```
<p align="center">
		<image src="/media/images/kibana-listen-port.png" width="100%"  />
</p>

Configure the Inbound port so the Kibana can be accessed from external
<p align="center">
    <image src="/media/images/kibana-inbound-port.png" width="100%"  />
</p>

Now you can start working on Kibana
<p align="center">
    <image src="/media/images/kibana-dashboard.png" width="100%"  />
</p>

### Security setup
The official setup can be referred from [here](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/configuring-security.html).

Run below command and manually input passwords for each service in ELK stack (including Elastic and Kibana). As noted from the [instruction](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/setup-passwords.html), this command can be used only at the first time setup, afterward the password management can be updated from Kibana UI.

```bash
cd /usr/share/elasticsearch/bin/
elasticsearch-setup-passwords interactive
```

One more steps to re-edit the kibana.yml file

```bash
# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
elasticsearch.username: kibana
elasticsearch.password: password-enter-previously
```

> **Warning**
>
> The password setup tool is located in elasticsearch binary folder, so this path can be different on variant versions and OS. There is a useful tutorial on how to handle this task from [Youtube](https://youtu.be/11PWoDIc10I?t=547).

## Quick tour with Kibana
As stated above, Kibana is a powerful tool to play as a central management for Elastic Stack. Below demonstrates its abilities in  monitoring cluster, infrastructure via Metricbeats or managing the users, index life cycle.  

- Monitor cluster
<p align="center">
		<image src="/media/images/kibana-monitor-3.png" width="100%"  />
</p>  

- Monitor infrastructure
<p align="center">
		<image src="/media/images/kibana-infra.png" width="100%"  />
</p>  

- Manage lifecycle
<p align="center">
		<image src="/media/images/kibana-lifecycle.png" width="100%"  />
</p>  

- Manage user roles
<p align="center">
		<image src="/media/images/kibana-users.png" width="100%"  />
</p>
