木花错误日志在哪里?是否有 kibana 错误日志



问题:如何调试 kibana? 是否有错误日志?

  • 问题1:木花4熬不了
  • 问题 2:我不知道 kibana 4 在哪里/是否记录错误

详:这是我启动 kibana,向端口发出请求,一无所获,然后再次检查服务。 该服务没有熬夜,但我不知道为什么。

vagrant@default-ubuntu-1204:/opt/kibana/current/config$ sudo service kibana start
kibana start/running, process 11774
vagrant@default-ubuntu-1204:/opt/kibana/current/config$ curl -XGET 'http://localhost:5601'
curl: (7) couldn't connect to host
vagrant@default-ubuntu-1204:/opt/kibana/current/config$ sudo service kibana status
kibana stop/waiting

这是nginx日志,当我从端口80卷曲-XGET时报告,该端口正在转发到端口5601:

2015/06/15 17:32:17 [error] 9082#0: *11 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: kibana, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5601/", host: "localhost"

更新:我可能想多了。 但是,我仍然对查看 kibana 日志的方法感兴趣! 任何建议不胜感激!

我注意到,当我从命令行运行 kibana 时,我看到的错误比"连接被拒绝"更具描述性

vagrant@default-ubuntu-1204:/opt/kibana/current$ bin/kibana
{"@timestamp":"2015-06-15T22:04:43.344Z","level":"error","message":"Service Unavailable","node_env":"production","error":{"message":"Service Unavailable","name":"Error","stack":"Error: Service Unavailablen  at respond (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/src/lib/transport.js:235:15)n  at checkRespForFailure (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/src/lib/transport.js:203:7)n  at HttpConnector.<anonymous> (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/src/lib/connectors/http.js:156:7)n  at IncomingMessage.bound (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)n  at IncomingMessage.emit (events.js:117:20)n  at _stream_readable.js:944:16n  at process._tickCallback (node.js:442:13)n"}}
{"@timestamp":"2015-06-15T22:04:43.346Z","level":"fatal","message":"Service Unavailable","node_env":"production","error":{"message":"Service Unavailable","name":"Error","stack":"Error: Service Unavailablen  at respond (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/src/lib/transport.js:235:15)n  at checkRespForFailure (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/src/lib/transport.js:203:7)n  at HttpConnector.<anonymous> (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/src/lib/connectors/http.js:156:7)n  at IncomingMessage.bound (/usr/local/kibana-4.0.2/src/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)n  at IncomingMessage.emit (events.js:117:20)n  at _stream_readable.js:944:16n  at process._tickCallback (node.js:442:13)n"}}
vagrant@default-ubuntu-1204:/opt/kibana/current$
默认情况下,

Kibana 4 会记录到stdout。以下是config/kibana.yml默认值的摘录:

# Enables you specify a file where Kibana stores log output.
# logging.dest: stdout

因此,当使用 service 调用它时,请使用该服务的日志捕获方法。例如,在使用Systemd/systemctl的Linux发行版上(例如RHEL 7+):

journalctl -u kibana.service

一种方法可能是修改 init 脚本以使用 --log-file 选项(如果它仍然存在),但我认为正确的解决方案是正确配置您的实例 YAML 文件。例如,将此添加到您的config/kibana.yml

logging.dest: /var/log/kibana.log

请注意,Kibana 进程必须能够写入您指定的文件,否则该进程将在没有信息的情况下死亡(这可能会非常混乱)。

至于--log-file选项,我认为这是为CLI操作保留的,而不是自动化。

在 kibana 4.0.2 中没有 --log-file 选项。如果我使用 kibana 启动 kibana 作为服务systemctl start kibana我会发现登录/var/log/messages

似乎你需要传递一个标志"-l, --log-file"

https://github.com/elastic/kibana/issues/3407

Usage: kibana [options]
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch.
Options:
    -h, --help                 output usage information
    -V, --version              output the version number
    -e, --elasticsearch <uri>  Elasticsearch instance
    -c, --config <path>        Path to the config file
    -p, --port <port>          The port to bind to
    -q, --quiet                Turns off logging
    -H, --host <host>          The host to bind to
    -l, --log-file <path>      The file to log to
    --plugins <path>           Path to scan for plugins

如果使用 init 脚本作为服务运行,也许需要对其进行自定义。

默认情况下,

Kibana 没有日志文件。 但您可以使用 Kibana 服务器属性 - https://www.elastic.co/guide/en/kibana/current/kibana-server-properties.html 进行设置log_file

对于 Windows 上的 kibana 6.x,编辑"kibana -l"文件夹的快捷方式必须存在。

最新更新