kibana 错误日志在哪里?是否有 kibana 错误日志?
Where is the kibana error log? Is there a kibana error log?
问题:如何调试 kibana?有错误日志吗?
- 问题 1:kibana 4 无法正常运行
- 问题 2:我不知道 where/if 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 时,我看到的错误比 "Connection refused" 更具描述性:
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 Unavailable\n 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:16\n 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 Unavailable\n 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:16\n at process._tickCallback (node.js:442:13)\n"}}
vagrant@default-ubuntu-1204:/opt/kibana/current$
看来你需要传递一个标志“-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
如果您使用初始化脚本 运行 作为服务,您可能需要对其进行自定义。
Kibana 默认没有日志文件。但您可以使用 log_file Kibana 服务器 属性 - https://www.elastic.co/guide/en/kibana/current/kibana-server-properties.html
进行设置
在 kibana 4.0.2 中没有 --log-file 选项。如果我使用 systemctl start kibana
启动 kibana 作为服务,我会发现登录 /var/log/messages
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
一种方法可能是修改初始化脚本以使用 --log-file
选项(如果它仍然存在),但我认为正确的解决方案是正确配置您的实例 YAML 文件。例如,将此添加到您的 config/kibana.yml
:
logging.dest: /var/log/kibana.log
请注意,Kibana 进程必须能够写入您指定的文件,否则该进程将在没有信息的情况下死亡(这可能会非常混乱)。
至于--log-file
选项,我认为这是为CLI操作保留的,而不是自动化。
对于 Windows 上的 kibana 6.x,编辑 "kibana -l " 文件夹的快捷方式必须存在。
问题:如何调试 kibana?有错误日志吗?
- 问题 1:kibana 4 无法正常运行
- 问题 2:我不知道 where/if 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 时,我看到的错误比 "Connection refused" 更具描述性:
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 Unavailable\n 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:16\n 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 Unavailable\n 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:16\n at process._tickCallback (node.js:442:13)\n"}}
vagrant@default-ubuntu-1204:/opt/kibana/current$
看来你需要传递一个标志“-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
如果您使用初始化脚本 运行 作为服务,您可能需要对其进行自定义。
Kibana 默认没有日志文件。但您可以使用 log_file Kibana 服务器 属性 - https://www.elastic.co/guide/en/kibana/current/kibana-server-properties.html
进行设置在 kibana 4.0.2 中没有 --log-file 选项。如果我使用 systemctl start kibana
启动 kibana 作为服务,我会发现登录 /var/log/messages
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
一种方法可能是修改初始化脚本以使用 --log-file
选项(如果它仍然存在),但我认为正确的解决方案是正确配置您的实例 YAML 文件。例如,将此添加到您的 config/kibana.yml
:
logging.dest: /var/log/kibana.log
请注意,Kibana 进程必须能够写入您指定的文件,否则该进程将在没有信息的情况下死亡(这可能会非常混乱)。
至于--log-file
选项,我认为这是为CLI操作保留的,而不是自动化。
对于 Windows 上的 kibana 6.x,编辑 "kibana -l " 文件夹的快捷方式必须存在。