问题:如何调试kibana?是否有错误日志?
详情: 在这里,我开始使用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 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$
答案 0 :(得分:44)
Kibana 4默认情况下记录到stdout
。以下是config/kibana.yml
默认值的摘录:
# Enables you specify a file where Kibana stores log output.
# logging.dest: stdout
因此,在使用service
调用它时,请使用该服务的日志捕获方法。例如,在使用Systemd / systemctl(例如RHEL 7+)的Linux发行版上:
journalctl -u kibana.service
一种方法可能是修改init脚本以使用--log-file
选项(如果它仍然存在),但我认为正确的解决方案是正确配置您的实例YAML文件。例如,将其添加到您的config/kibana.yml
:
logging.dest: /var/log/kibana.log
请注意,Kibana进程必须能够写入您指定的文件,否则进程将在没有信息的情况下死亡(这可能非常令人困惑)。
对于--log-file
选项,我认为这是为CLI操作而不是自动化保留的。
答案 1 :(得分:2)
似乎你需要传递一个标志“-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脚本作为服务运行,则可能需要对其进行自定义。
答案 2 :(得分:2)
Kibana默认没有日志文件。但您可以使用log_file Kibana服务器属性 - https://www.elastic.co/guide/en/kibana/current/kibana-server-properties.html
进行设置答案 3 :(得分:2)
在kibana 4.0.2中没有--log-file选项。如果我使用systemctl start kibana
作为服务启动kibana,我会找到登录/var/log/messages
答案 4 :(得分:0)
对于Windows上的kibana 6.x,编辑“kibana -l”文件夹必须存在的快捷方式。