【发布时间】:2019-06-09 11:58:57
【问题描述】:
我正在尝试以批量方式发送大约 30MB 的数据,它正在破坏 这个错误并没有说太多,但是当数据大小 id 小于它的工作正常时,我怀疑它只是因为大小?我通过 ES 6.4 API doc 找不到任何这样的限制,你知道为什么会这样吗?我可以设置限制吗
Elasticsearch ERROR: 2019-01-14T15:32:36Z
Error: Request error, retrying
POST http://xx.xx.xx.xx:yyyy/_bulk => read ECONNRESET
at Log.error (D:\UBX\UBX_WS\NodeAngular\myapp\node_modules\elasticsearch\src\lib\log.js:226:56)
at checkRespForFailure (D:\UBX\UBX_WS\NodeAngular\myapp\node_modules\elasticsearch\src\lib\transport.js:259:18)
at HttpConnector.<anonymous> (D:\UBX\UBX_WS\NodeAngular\myapp\node_modules\elasticsearch\src\lib\connectors\http.js:163:7)
at ClientRequest.wrapper (D:\UBX\UBX_WS\NodeAngular\myapp\node_modules\lodash\lodash.js:4935:19)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at ClientRequest.wrapped (D:\UBX\UBX_WS\NodeAngular\myapp\node_modules\newrelic\lib\transaction\tracer\index.js:181:22)
at ClientRequest.wrappedRequestEmit (D:\UBX\UBX_WS\NodeAngular\myapp\node_modules\newrelic\lib\instrumentation\core\http-outbound.js:138:26)
at Socket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
客户端创建
this.client = new elasticsearch.Client({
log: 'info',
hosts: 'xxxxx',
apiVersion: '6.4',
keepAlive: true,
suggestCompression: true,
requestTimeout: 1000 * 60 * 60,
createNodeAgent: (httpConnector, config) => {
let Agent = httpConnector.hand.Agent;
let agentConfig = httpConnector.makeAgentConfig(config);
agentConfig.keepAliveTimeout = 1000 * 60 * 60;
return new Agent(agentConfig);
}
});
**Sending bulk data**
ESClient.bulk({ body },
function (err, resp) {
if (err) {
log.error('bulkUpdateOrDelete failed with error - ', JSON.stringify(err));
reject(err);
} else {
log.debug('************* bulkUpdateOrDelete success with response - ', JSON.stringify(resp));
log.debug(JSON.stringify(resp));
resolve(resp);
}
});
【问题讨论】:
标签: node.js elasticsearch elasticsearch-5