es_rejected_execution_exception: es_rejected_execution_exception: rejected execution of ... on ... (queue capacity ...) (HTTP 429)(线程池队列已满,执行被拒绝)
Elasticsearch含义
由于相关线程池(search、write/bulk 等)的队列容量已满,操作被拒绝。在过载情况下,Elasticsearch 通过拒绝请求(背压)来保护自身,并返回 HTTP 429(Too Many Requests)。
原因
并发请求量非常高、bulk 请求非常大或非常频繁、繁重的聚合/搜索负载、节点/CPU 资源不足,或线程池队列相对工作负载过小。
解决方法
在客户端以指数退避方式重试;429 通常是瞬时的。减小 bulk 批次大小和发送速率,降低并发度。监控被拒绝的操作:GET _cat/thread_pool?v&h=node_name,name,active,queue,rejected。对于持续负载,增加节点/资源(水平扩展)。增大队列大小是最后手段;根本原因在于容量。
同一数据库的其他条目
- resource_already_exists_exceptionresource_already_exists_exception: index [index_name/uuid] already exists (HTTP 400)(索引已存在)
- cluster_health_redcluster health status: RED / unassigned shards(集群健康状态:RED / 未分配的分片)
- no_shard_available_action_exceptionno_shard_available_action_exception: No shard available for [...](没有可用的分片)
- master_not_discovered_exceptionmaster_not_discovered_exception / MasterNotDiscoveredException(未发现 master 节点)
- security_exceptionsecurity_exception: unable to authenticate / action [...] is unauthorized for user [...] (HTTP 401/403)(无法认证 / 用户无权执行该操作)
- validation_exceptionvalidation_exception / illegal_argument_exception: Validation Failed: ...(校验失败)
- task_cancelled_exceptiontask_cancelled_exception: Task was cancelled / TaskCancelledException(任务已被取消)