elasticsearch - 显示和更改参数 threadpool.bulk.queue_size
问题描述
我使用的是 elasticsearch 6.7.2 版,但出现错误 429
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[localhost][localhost:9300][indices:data/write/bulk[s]]"
}
],
"type": "es_rejected_execution_exception",
"reason": "rejected execution of processing of [682604930][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[hboauth2-2020.04.20-000113][0]] containing [index {[hboauth2][_doc][yRuEnHEBn6z33bhuCGjZ], source[{\"Action\":\"Service UpdateUserStatus Start\",\"ClientID\":\"\",\"Code\":0,\"Component\":\"UpdateUserStatus\",\"CustomMessage\":\"\",\"Data\":\"null\",\"LogDate\":1587468830939,\"Message\":\"{OK false}\",\"Type\":\"Info\",\"UserID\":\"4c220ab2-282d-466f-a9f5-da0e59b7b803\"}]}], target allocation id: wZFZUPi5TnSYFg-BNonHug, primary term: 1 on EsThreadPoolExecutor[name = localhost/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@744831b0[Running, pool size = 16, active threads = 16, queued tasks = 224, completed tasks = 264136589]]"
},
"status": 429
}
我找到了解决问题的方法,但是在我的版本中找不到参数threadpool.bulk.queue_size。你能帮我找到和改变这个参数吗
解决方案
如官方示例所示,您可以使用 elasticsearch.config 中的以下配置更改批量线程池的队列大小或更新集群设置。
请注意,写入线程池用于批量请求,如同一链接中所述:
write 用于单文档索引/删除/更新和批量请求。线程池类型的大小固定为可用处理器数,queue_size 为 200。此池的最大大小为 1 + 可用处理器数。
thread_pool:
write:
size: 30. --> no if threads in your case, its 16 as shown in exception
queue_size: 400 --> here you can add `queue_size`
还提到了有关更改这些设置的说明
可以通过设置特定类型的参数来更改特定的线程池;例如,改变写线程池中的线程数:
编辑:正如@val 在评论部分指出的那样,添加关于更改这些默认设置的免责声明。
请了解这些设置的技术细节和影响,因为这些通常不建议更改,更多信息请参阅此官方博客
推荐阅读
- docker - Nginx 没有重定向到正确的端口
- angular - Angular 5 @Input 属性不是延迟加载模块中组件的已知属性
- java - 在 DocumentBuilderFactory 的 setFeature 中设置本地特征
- android - Kotlin 错误:不能使用提供的参数调用以下函数
- java - 在 Hadoop Map/reduce 中计算 shuffle 时间
- laravel - Laravel 在两个不同端口上本地为应用程序提供服务,以使用 guzzle 返回 502 错误进行 api 调用
- c++ - 当服务器不可用并且即使在服务器启动后也不会更改为 CONNECTING 时,grpc 通道状态处于暂时故障状态
- vb6 - 开发Visual Basic Excel DLL Addins - 项目描述/启动程序
- java - 无法获取节点 ID 和节点标签,Spring Data Neo4j
- python - Anaconda jupyter notebook“连接失败”错误