更改后 Kibana 在 CentOs 7 上启动失败 logging.dest

Kibana failed to start on CentOs 7 after changing logging.dest

当我更改 /etc/kibana/kibana.yml

的第 92 行时
# Enables you specify a file where Kibana stores log output.
# logging.dest: stdout
logging.dest: /var/log/kibana/kibana.log # line 92

那么 kibana 没有正确启动。 当注释 /etc/kibana/kibana.yml 的第 92 行时正确启动

jounarlctl

的输出
sie 16 17:32:51 test.org.pl systemd[1]: Starting Kibana...
sie 16 17:32:52 test.org.pl kibana[3083]: FATAL CLI ERROR YAMLException: bad indentation of a mapping entry at line 92, column 2:
sie 16 17:32:52 test.org.pl systemd[1]: kibana.service: main process exited, code=exited, status=1/FAILURE
sie 16 17:32:52 test.org.pl systemd[1]: Unit kibana.service entered failed state.
sie 16 17:32:52 test.org.pl systemd[1]: kibana.service failed.
sie 16 17:32:52 test.org.pl systemd[1]: kibana.service holdoff time over, scheduling restart.
sie 16 17:32:52 test.org.pl systemd[1]: Started Kibana.ervice
sie 16 17:32:52 test.org.pl systemd[1]: Starting Kibana...
sie 16 17:32:53 test.org.pl systemd[1]: kibana.service: main process exited, code=exited, status=1/FAILURE
sie 16 17:32:53 test.org.pl systemd[1]: Unit kibana.service entered failed state.
sie 16 17:32:53 test.org.pl systemd[1]: kibana.service failed.
sie 16 17:32:53 test.org.pl systemd[1]: kibana.service holdoff time over, scheduling restart.
sie 16 17:32:53 test.org.pl systemd[1]: Started Kibana.
sie 16 17:32:53 test.org.pl systemd[1]: Starting Kibana...
sie 16 17:32:54 test.org.pl systemd[1]: kibana.service: main process exited, code=exited, status=1/FAILURE
sie 16 17:32:54 test.org.pl systemd[1]: Unit kibana.service entered failed state.
sie 16 17:32:54 test.org.pl systemd[1]: kibana.service failed.
sie 16 17:32:54 test.org.pl systemd[1]: kibana.service holdoff time over, scheduling restart.
sie 16 17:32:54 test.org.pl systemd[1]: start request repeated too quickly for kibana.service
sie 16 17:32:54 test.org.pl systemd[1]: Failed to start Kibana.
sie 16 17:32:54 test.org.pl systemd[1]: Unit kibana.service entered failed state.
sie 16 17:32:54 test.org.pl systemd[1]: kibana.service failed.

我在 /etc/

中创建了这个文件夹
drwxr-xr-x. 2 root          root             6 08-10 16:00 kibana

我以 daemon

启动 Kibana
systemctl restart kibana

Kibana 是版本 5.5.1

更新

我尝试手动制作此文件,但 kibana 之后无法启动:

    [root@localhost kibana]# ls -lh
razem 8,0K
-rw-r--r--. 1 kibana kibana    0 08-17 10:17 kibana.log
-rw-r--r--. 1 root   root     78 06-19 15:26 kibana.stderr
-rw-r--r--. 1 root   root   1,4K 06-19 15:26 kibana.stdout
[root@localhost kibana]# pwd
/var/log/kibana

journalctl

sie 17 10:20:05 localhost.localdomain systemd[1]: Starting Kibana...
sie 17 10:20:05 localhost.localdomain systemd[1]: Started Kibana.
sie 17 10:20:07 localhost.localdomain kibana[10222]: FATAL CLI ERROR YAMLException: bad indentation of a mapping entry at line 93, column 2:
sie 17 10:20:07 localhost.localdomain kibana[10222]: logging.dest: /var/log/kibana/ki ...
sie 17 10:20:07 localhost.localdomain kibana[10222]: ^
sie 17 10:20:07 localhost.localdomain kibana[10222]: at generateError (/usr/share/kibana/node_modules/js-yaml/lib/js-yaml/loader.js:160:10)

配置文件中不允许 space。

出于某种原因,kibana 不知道自己创建日志文件。所以你必须先手动创建它并设置正确的所有权。可以这样实现:

touch /var/log/kibana.log
chown kibana:kibana /var/log/kibana.log

然后发出 systemctl restart kibana 然后你就可以开始了!

您可以通过以下方式查看日志:tailf /var/log/kibana.log

cat /var/log/kibana.log