Elasticsearch异常:es_rejected_execution_exception

uubf1zoe  于 2023-08-03  发布在  ElasticSearch
关注(0)|答案(1)|浏览(431)

获取数据到elasticsearch时出错。

{
"error": {
    "root_cause": [
        {
            "type": "remote_transport_exception",
            "reason": "[10.23.10.165][10.23.10.165:9300][indices:data/write/bulk[s][p]]"
        }
    ],
    "type": "es_rejected_execution_exception",
    "reason": "rejected execution of processing of [249060237][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[19-01-2022_content_vod][0]] containing [index {[content_vod][_doc][2581344], source[n/a, actual length: [3kb], max length: 2kb]}], target allocation id: 7kXMhnrkREmTkY5X9Dr8LQ, primary term: 8 on EsThreadPoolExecutor[name = 10.23.10.165/write, queue capacity = 5000, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@6b7dd2e7[Running, pool size = 4, active threads = 4, queued tasks = 5000, completed tasks = 11276660]]"
},
"status": 429

字符串
}

我的设置是默认设置,为了解决这个问题,所有elasticsearch设置都应该更改。
请建议理想的线程池设置。

我的Elasticsearch运行在C5.8xLarge机器上,有4个节点。

cs7cruho

cs7cruho1#

search/write queue/threadpool满时,Elasticsearch会抛出es_rejected_execution_exception。如果你有一个重试机制的索引(例如消息队列(如Kafka或RabbitMQ)不会有任何问题,并且用于索引的应用程序将重试索引。如果没有重试机制,可能会导致数据丢失
您共享的日志中的当前queue capacity为5k,由于索引率高,它已被填充。

增加写队列容量只会延迟es_rejected_execution_exception。要解决这个问题,你可以查看这篇文章。

https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html
要查找根本原因并监视群集,可以使用Opster AutoOps

相关问题