本文介绍在 CentOS 7.x 操作系统上安装 Kibana 6.x 的方法与过程。
版本说明
- CentOS 7.6
- Oracle JDK 1.8.0_231
- Kibana 6.8.5
安装步驟
下载 Kibana ,本示例使用 6.8.5 版本,下载文件是
kibana-6.8.5-linux-x86_64.tar.gz
。执行解压命令
tar -xvf kibana-6.8.5-linux-x86_64.tar.gz
。输入命令
./kibana-6.8.5-linux-x86_64/bin/kibana
启动运行。
[root@... kibana]# ./kibana-6.8.5-linux-x86_64/bin/kibana
log [09:25:55.023] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.070] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.073] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.081] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.093] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.097] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.106] [warning][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
log [09:25:55.112] [warning][security] Session cookies will be transmitted over insecure connections. This is not recommended.
log [09:25:55.120] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.142] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.144] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.193] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.195] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.209] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.215] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.217] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.224] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.262] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.265] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.268] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.272] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.277] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.287] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.292] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.294] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.295] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.314] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.316] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.320] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.322] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.372] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.374] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.387] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.393] [info][status][plugin:[email protected]] Status changed from uninitialized to yellow - Waiting for Elasticsearch
log [09:25:55.404] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.417] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.433] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.436] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.448] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:55.608] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:56.651] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.732] [info][license][xpack] Imported license information from Elasticsearch for the [data] cluster: mode: basic | status: active
log [09:25:56.739] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.740] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.741] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.741] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.742] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.742] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.743] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.743] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.743] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.744] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.744] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.744] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.745] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.745] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.746] [info][kibana-monitoring][monitoring-ui] Starting monitoring stats collection
log [09:25:56.754] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.755] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
log [09:25:56.809] [info][license][xpack] Imported license information from Elasticsearch for the [monitoring] cluster: mode: basic | status: active
log [09:25:58.691] [warning][browser-driver][reporting] Enabling the Chromium sandbox provides an additional layer of protection.
log [09:25:58.693] [warning][reporting] Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set xpack.reporting.encryptionKey in kibana.yml
log [09:25:58.716] [info][status][plugin:[email protected]] Status changed from uninitialized to green - Ready
log [09:25:58.767] [info][task_manager] Installing .kibana_task_manager index template version: 6080599.
log [09:25:59.337] [info][task_manager] Installed .kibana_task_manager index template: version 6080599 (API version 1)
log [09:25:59.936] [info][migrations] Creating index .kibana_1.
log [09:26:00.087] [info][migrations] Pointing alias .kibana to .kibana_1.
log [09:26:00.129] [info][migrations] Finished in 193ms.
log [09:26:00.131] [info][listening] Server running at http://localhost:5601
log [09:26:01.008] [info][status][plugin:[email protected]] Status changed from yellow to green - Ready
配置远程访问
- 远程计算机无法访问以默认配置启动的 Kibana 服务,编辑
config
目录下kibana.yml
配置文件,找到server.host
,修改为以下内容。
# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "0.0.0.0"
- 重启 Kibana 服务后,在远程计算机上打开浏览器,输入地址
[Kibana 服务 IP]:5601
访问。
后台运行
[root@... kibana]# nohup ./kibana-6.8.5-linux-x86_64/bin/kibana &
[1] 2630
[root@... kibana]# nohup: ignoring input and appending output to ‘nohup.out’
[root@... kibana]# ps -ef | grep kibana
root 2630 120649 82 17:31 pts/0 00:00:12 ./kibana-6.8.5-linux-x86_64/bin/../node/bin/node --no-warnings --max-http-header-size=65536 ./kibana-6.8.5-linux-x86_64/bin/../src/cli
root 2716 120649 0 17:32 pts/0 00:00:00 grep --color=auto kibana
停止运行
[root@... kibana]# kill -9 2630
[root@... kibana]# ps -ef | grep kibana
root 2816 120649 0 17:32 pts/0 00:00:00 grep --color=auto kibana
常见问题
- 启动提示端口占用
(1) 执行 kill -9
命令关闭 Kibana 进程。
[root@... bin]# ps -ef|grep kibana
root 2946 1 0 Nov23 ? 01:08:24 ./kibana-6.8.5-linux-x86_64/bin/../node/bin/node --no-warnings --max-http-header-size=65536 ./kibana-6.8.5-linux-x86_64/bin/../src/cli
root 14460 115056 0 17:22 pts/0 00:00:00 grep --color=auto kibana
[root@... bin]# kill -9 2946
[root@... bin]# ps -ef|grep kibana
root 14480 115056 0 17:22 pts/0 00:00:00 grep --color=auto kibana
(2) 再次启动提示 FATAL Error: Port 5601 is already in use.
,执行 ps -ef|grep kibana
命令查找不到 Kibana 进程,但是浏览器可以访问。
[root@... kibana]# ./kibana-6.8.5-linux-x86_64/bin/kibana
log [09:24:36.331] [fatal][root] Error: Port 5601 is already in use. Another instance of Kibana may be running!
at Root.shutdown (/opt/kibana/kibana-6.8.5-linux-x86_64/src/core/server/root/index.js:53:26)
at Root.start (/opt/kibana/kibana-6.8.5-linux-x86_64/src/core/server/root/index.js:45:24)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
FATAL Error: Port 5601 is already in use. Another instance of Kibana may be running!
[root@... kibana]# ps -ef|grep kibana
root 15002 115056 0 17:24 pts/0 00:00:00 grep --color=auto kibana
解决方法:执行其它命令查看 Kibana 端口(5601
)占用情况,如 netstat -ntulp | grep 5601
或 fuser -n tcp 5601
,然后执行 kill -9
命令关闭 5601
端口占用进程,再次启动 Kibana。
注意:按以上方法启动 Kibana 还是无法通过 ps -ef|grep kibana
命令查找到 Kibana 进程,只能使用其它命令。
[root@... kibana]# netstat -ntulp | grep 5601
tcp 0 0 0.0.0.0:5601 0.0.0.0:* LISTEN 14581/./bin/../node
[root@... bin]# fuser -n tcp 5601
5601/tcp: 14581
[root@... bin]# kill -9 14581
附
Kibana User Guide