写入 Elasticsearch 时出错,无法从数据流中插入某些元素

Error writing to Elasticsearch, some elements could not be inserted from dataflow

elasticsearch 版本 6.8.5
ElasticsearchIO 2.15.0
数据流版本 2.15.0

我的集群中有 3 个节点,在同一台机器上,我在 gcp 中有一个实例,有 6 个内核和 16GB 内存,我为每个节点设置了 4GB

我有5个索引 每个索引 2 个分片 2 个副本

数据流在 2 分钟内发送到 elasticsearch 总共 2K 条记录到每个索引总共 10K 条记录

并向我发送下一个错误

java.io.IOException: Error writing to Elasticsearch, some elements could not be inserted:
Document id jnlmbW8BnhRHn7hU2cLS: rejected execution of processing of [10948][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[indexname][0]] containing [3] requests, target allocation id: M40WguEMSTmWedf2c6LuAg, primary term: 1 on EsThreadPoolExecutor[name = C2JZ4zA/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@51a06c32[Running, pool size = 6, active threads = 6, queued tasks = 224, completed tasks = 1026]] (es_rejected_execution_exception)

我在elasticsearch中检查结果和记录丢失
例如数据流说处理 1850 条记录,在弹性搜索中有 1800 有什么想法吗?

这意味着您使请求队列不堪重负。您的队列已满,节点刚刚开始忽略新请求。 您可以尝试增加队列的大小,如您所见 here 如果增加队列大小不起作用,则必须增加处理能力(通过添加新节点或改进现有节点)或减少一段时间内的请求数。首先我建议你监控你的节点并注意发生了什么。

希望对你有所帮助