我正在尝试索引一个12mb的日志文件,其中包含50,000个日志。在索引了大约30,000个日志之后,我得到了以下错误
[2018-04-17T05:52:48,254][INFO ][logstash.outputs.elasticsearch] retrying failed action with response code: 429 ({"type"=>"es_rejected_execution_exception", "reason"=>"rejected execution of org.elasticsearch.transport.TransportService$7@560f63a9 on EsThreadPoolExecutor[name = EC2AMAZ-1763048/bulk, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@7d6ae98b[Running, pool size = 2, active threads = 2, queued tasks = 200, completed tasks = 3834]]"})
但是,我已经阅读了文档和elasticsearch论坛,它们建议我增加elasticsearch批量队列大小。我试着使用curl,但是我不能这样做。
curl -XPUT localhost:9200/_cluster/settings -d '{"persistent" : {"threadpool.bulk.queue_size" : 100}}'
增加队列大小是好的选择吗?我不能增加硬件,因为我有更少的数据。
我面临的错误是由于队列大小的问题还是其他原因?如果有队列大小,如何在elasticsearch.yml中更新队列大小,在elasticsearch.yml中更新后是否需要重新启动es?
请让我知道。耽误您时间,实在对不起
发布于 2018-04-18 00:37:59
一旦您的索引无法跟上索引请求,elasticsearch就会将它们放入threadpool.bulk.queue中,如果队列中的请求数超过elasticsearch,就开始拒绝它们
这是一个好主意,考虑限制您的索引。线程池大小默认值通常是好的;虽然您可以增加它们,但您可能没有足够的资源(内存、CPU )可用。
这个来自elastic.co的blogpost很好地解释了这个问题。
https://stackoverflow.com/questions/49873853
复制相似问题