search写入数据报错:org.elasticsearch.common.util.concurrent.EsRejectedExecutionException

  其他常见问题
内容纲要

概要描述


search写入数据时报错:org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution of org.elasticsearch.transport.TransportService$7@6990af57 on EsThreadPoolExecutor[bulk, queue capacity = 5000, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@748a2ff5[Running, pool size = 32, active threads = 32, queued tasks = 5001, completed tasks = 220007988]]

详细说明


  1. search在写入数据时,报如下错误:
    file

  2. 该报错信息表示elasticsearch bulk操作线程池大小为32,等待队列大小为5001,均已满,因此再往es发送bulk请求,es拒绝改请求,抛出EsRejectedExecutionException

解决方案


  1. 如果search版本是4.x版本,通过curl命令调大es bulk等待队列的大小
    比如下面命令是将es bulk等待队列调整为6000。

    curl -XPUT ‘localhost:9200/_cluster/settings’ -d ‘{
    "persistent": {
    "threadpool.bulk.type": "fixed",
    "threadpool.bulk.queue_size": 6000
    }
    }’

  2. 如果search版本是5.x及以上版本,在manager页面修改
    在search参数页面修改 thread_pool.bulk.queue_size,修改为实际值之后,配置服务,重启search服务生效。
    file

这篇文章对您有帮助吗?

平均评分 0 / 5. 次数: 0

尚无评价,您可以第一个评哦!

非常抱歉,这篇文章对您没有帮助.

烦请您告诉我们您的建议与意见,以便我们改进,谢谢您。