概要描述
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]]
详细说明
-
search在写入数据时,报如下错误:
-
该报错信息表示elasticsearch bulk操作线程池大小为32,等待队列大小为5001,均已满,因此再往es发送bulk请求,es拒绝改请求,抛出EsRejectedExecutionException
解决方案
-
如果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
}
}’ -
如果search版本是5.x及以上版本,在manager页面修改
在search参数页面修改thread_pool.bulk.queue_size
,修改为实际值之后,配置服务,重启search服务生效。