Kibana 是一款开源的数据分析和可视化平台,它是 Elastic Stack 成员之一,设计用于和 Elasticsearch 协作。您可以使用 Kibana 对 Elasticsearch 索引中的数据进行搜索、查看、交互操作。您可以很方便的利用图表、表格及地图对数据进行多元化的分析和呈现。
官网:https://www.elastic.co/cn/products/kibana
安装文件下载地址:https://download.csdn.net/download/zhangxm_qz/12556563
下载并加压安装文件 ,解压后目录结构如下:
解压命令 :tar -zvxf kibana-6.5.4-linux-x86_64.tar.gz
[root@localhost apps]# ls
elasticsearch-6.5.4 kibana
elasticsearch-6.5.4.tar.gz kibana-6.5.4-linux-x86_64
elsearch kibana-6.5.4-linux-x86_64.tar.gz
filebeat metricbeat
filebeat-6.5.4-linux-x86_64 metricbeat-6.5.4-linux-x86_64
filebeat-6.5.4-linux-x86_64.tar.gz metricbeat-6.5.4-linux-x86_64.tar.gz
jdk nginx
jdk1.8.0_191 nginx-1.12.2
jdk-8u191-linux-x64.tar.gz nginx-1.12.2.tar.gz
修改 config/kibana.yml 文件 增加如下配置
server.host: "192.168.12.10" #对外暴露服务的地址
elasticsearch.url: "http://192.168.12.10:9200" #配置Elasticsearch
启动 kibana
./bin/kibana
启动后访问地址:http://192.168.12.10:5601/app/kibana 可以进入kibana
Management 菜单下点击 index patterns 将es中的索引添加到 kibana
过滤并选择索引
添加完成后 discover菜单中可以查询索引中的数据,如下
可以将Metricbeat的数据在Kibana中展示
修改配置
[root@localhost metricbeat]# vi metricbeat.yml
metricbeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 1
index.codec: best_compression
setup.kibana:
host: "192.168.12.10:5601"
output.elasticsearch:
hosts: ["192.168.12.10:9200","192.168.12.11:9200","192.168.12.12:9200"]
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
安装dashboards 到kibana
[root@localhost metricbeat]# ./metricbeat setup --dashboards
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards
即可在Kibana中看到仪表盘数据:
选择某一个看板 可以查看效果
filebeat配置文件 test-nginx.yml 内容修改为:
[root@localhost filebeat]# vi test-nginx.yml
filebeat.inputs:
setup.template.settings:
index.number_of_shards: 3
output.elasticsearch:
hosts: ["192.168.12.10:9200","192.168.12.11:9200","192.168.12.12:9200"]
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.kibana:
host: "192.168.12.10:5601"
安装仪表盘到kibana
./filebeat -c itcast-nginx.yml setup
安装成功后在kibana中可以看到filebeat的dashboard
visualize界面点击添加按钮
配置好图表后可以点击保存按钮保存图表
自定义图表也可以添加到dashboards中
添加自定义图表并展示