介绍:
Kibana 是一个开源分析数据可视化平台。你可以使用 Kibana 对数据进行高效的搜索、可视化、分析,还可以与 Elasticsearch 搜索引擎之中的数据进行交互。
Kibana 可以轻松掌握大量的数据。 其基于浏览器的界面使您能够快速创建共享动态仪表板,实时监控 ElasticSearch 的查询与更改。
先决条件:
要求:Kibana 与 Elasticsearch 的版本必须一致。
1.创建用户和组
$ groupadd kibana $ useradd -g kibana kibana
2.安装 Kibana
下载地址://www.elastic.co/products
解压创建软连接:
$ cd /tmp $ sha1sum kibana-5.6.3-linux-x86_64.tar.gz $ tar zxvf kibana-5.6.3-linux-x86_64.tar.gz $ mv kibana-5.6.3-linux-x86_64 /usr/local $ cd /usr/local $ ln -s kibana-5.6.3-linux-x86_64 kibana
3.配置 kibana
配置完成后的内容如下:
$ egrep -v "^$|^#|^;" /usr/local/kibana/config/kibana.yml server.port: 5601 server.host: "10.28.204.65" server.name: "10.28.204.65" elasticsearch.url: "//10.28.204.65:9200" elasticsearch.preserveHost: true elasticsearch.pingTimeout: 1500 elasticsearch.requestTimeout: 30000 pid.file: /usr/local/kibana/kibana.pid更多配置请参阅配置 Kibana。
4.赋予 Kibana 目录权限
$ cd /usr/local $ chown -R kibana.kibana kibana*
5.启动 kibana
$ cd /usr/local/kibana/bin $ ./kibanalog [02:01:19.285] [info][status][plugin:kibana@5.6.3] Status changed from uninitialized to green - Ready log [02:01:19.819] [info][status][plugin:elasticsearch@5.6.3] Status changed from uninitialized to yellow - Waiting for Elasticsearch log [02:01:20.078] [info][status][plugin:console@5.6.3] Status changed from uninitialized to green - Ready log [02:01:20.288] [info][status][plugin:metrics@5.6.3] Status changed from uninitialized to green - Ready log [02:01:21.263] [info][status][plugin:timelion@5.6.3] Status changed from uninitialized to green - Ready log [02:01:21.306] [info][listening] Server running at //10.28.204.65:5601 log [02:01:21.315] [info][status][ui settings] Status changed from uninitialized to yellow - Elasticsearch plugin is yellow log [02:01:25.304] [info][status][plugin:elasticsearch@5.6.3] Status changed from yellow to yellow - No existing Kibana index found log [02:01:29.992] [info][status][plugin:elasticsearch@5.6.3] Status changed from yellow to green - Kibana index ready log [02:01:30.008] [info][status][ui settings] Status changed from yellow to green - Ready打印出了启动状态,已经启动成功。
现在你可以使用 //10.28.204.65:5601 进行访问配置即可。
6.创建 systemctl 系统 Kibana 单元文件
我们需要创建单元服务文件,目的是为了便于管理:
$ vim /usr/lib/systemd/system/kibana.service添加以下内容:
[Unit] Description=Kibana [Service] Type=simple User=kibana Group=kibana # Load env vars from /etc/default/ and /etc/sysconfig/ if they exist. # Prefixing the path with '-' makes it try to load, but if the file doesn't # exist, it continues onward. EnvironmentFile=-/usr/local/kibana/config EnvironmentFile=-/etc/sysconfig/kibana ExecStart=/usr/local/kibana/bin/kibana "-c /usr/local/kibana/config/kibana.yml" Restart=always WorkingDirectory=/ [Install] WantedBy=multi-user.target
7.启动并加入开机启动
$ systemctl restart kibana $ systemctl enable kibana
8.设置防火墙
$ firewall-cmd --permanent --zone=public --add-port=5601/tcp $ firewall-cmd --reload
到目前为止 Kibana 已经安装完成,并可以正常使用。