我正在尝试使用Elasticsearch-Kibana-Logstash处理Web日志文件。
有些查询需要花费一些时间,而Kibana很快就会超时,所以我想增加Kibana等待elasticsearch响应的时间。经过一些搜索,我找到了一些设置elasticsearch.requestTimeout
的建议。我试图通过将此添加到我的kibana.yml文件来增加超时:
elasticsearch.requestTimeout: 5000
这会导致Kibana在启动时立即失败并出现此错误:
kibserver_1 | FATAL { Error: Payload timeout must be shorter than socket timeout: POST /elasticsearch/{index}/_search kibserver_1 | at Object.exports.assert (/usr/share/kibana/node_modules/hoek/lib/index.js:736:11) kibserver_1 | at new module.exports.internals.Route (/usr/share/kibana/node_modules/hapi/lib/route.js:69:10) kibserver_1 | at internals.Connection._addRoute (/usr/share/kibana/node_modules/hapi/lib/connection.js:387:19) kibserver_1 | at internals.Connection._route (/usr/share/kibana/node_modules/hapi/lib/connection.js:379:18) kibserver_1 | at internals.Plugin._apply (/usr/share/kibana/node_modules/hapi/lib/plugin.js:572:14) kibserver_1 | at internals.Plugin.route (/usr/share/kibana/node_modules/hapi/lib/plugin.js:542:10) kibserver_1 | at createProxy (/usr/share/kibana/src/core_plugins/elasticsearch/lib/create_proxy.js:85:14) kibserver_1 | at ScopedPlugin.init [as externalInit] (/usr/share/kibana/src/core_plugins/elasticsearch/index.js:110:37) kibserver_1 | at ScopedPlugin.tryCatcher (/usr/share/kibana/node_modules/bluebird/js/main/util.js:26:23) kibserver_1 | at Promise.attempt.Promise.try (/usr/share/kibana/node_modules/bluebird/js/main/method.js:30:24) kibserver_1 | at /usr/share/kibana/src/server/plugins/plugin.js:196:46 kibserver_1 | at next (native) kibserver_1 | at step (/usr/share/kibana/src/server/plugins/plugin.js:25:191) kibserver_1 | at /usr/share/kibana/src/server/plugins/plugin.js:25:361 kibserver_1 | cause: kibserver_1 | Error: Payload timeout must be shorter than socket timeout: POST /elasticsearch/{index}/_search kibserver_1 | at Object.exports.assert (/usr/share/kibana/node_modules/hoek/lib/index.js:736:11) kibserver_1 | at new module.exports.in how to resolternals.Route (/usr/share/kibana/node_modules/hapi/lib/route.js:69:10) kibserver_1 | at internals.Connection._addRoute (/usr/share/kibana/node_modules/hapi/lib/connection.js:387:19) kibserver_1 | at internals.Connection._route (/usr/share/kibana/node_modules/hapi/lib/connection.js:379:18) kibserver_1 | at internals.Plugin._apply (/usr/share/kibana/node_modules/hapi/lib/plugin.js:572:14) kibserver_1 | at internals.Plugin.route (/usr/share/kibana/node_modules/hapi/lib/plugin.js:542:10) kibserver_1 | at createProxy (/usr/share/kibana/src/core_plugins/elasticsearch/lib/create_proxy.js:85:14) kibserver_1 | at ScopedPlugin.init [as externalInit] (/usr/share/kibana/src/core_plugins/elasticsearch/index.js:110:37) kibserver_1 | at ScopedPlugin.tryCatcher (/usr/share/kibana/node_modules/bluebird/js/main/util.js:26:23) kibserver_1 | at Promise.attempt.Promise.try (/usr/share/kibana/node_modules/bluebird/js/main/method.js:30:24) kibserver_1 | at /usr/share/kibana/src/server/plugins/plugin.js:196:46 kibserver_1 | at next (native) kibserver_1 | at step (/usr/share/kibana/src/server/plugins/plugin.js:25:191) kibserver_1 | at /usr/share/kibana/src/server/plugins/plugin.js:25:361, kibserver_1 | isOperational: true }
这个令我感到困惑。我似乎无法找到任何对有效载荷超时的引用"在ElasticSearch文档中。我的网络搜索表明这可能来自hapijs,但我不知道如何解决这个问题。那边有人知道吗?
(Kibana,ElasticSearch和Logstash都是v 6.1.0)
答案 0 :(得分:1)
我认为问题在于你将超时设置为一个太小的值,它以毫秒为单位,默认值为30000(见https://www.elastic.co/guide/en/kibana/6.1/settings.html):
elasticsearch.requestTimeout
:默认值:30000 等待来自后端或Elasticsearch的响应的时间(以毫秒为单位)。该值必须是正整数。
可能的是elasticsearch.requestTimeout
用于在hapijs中设置套接字超时,因为有效负载超时的默认值似乎是10秒(from here):
route.options.payload.timeout
默认值:10000(10秒)。
检查有效负载超时是否短于套接字超时时,它将失败。但这只是一个假设,我在Kibana的代码中找不到任何证据。