cluster_health_red: cluster health status: RED / unassigned shards(集群健康状态:RED / 未分配的分片)
Elasticsearch含义
集群健康状态为 RED 表示至少有一个主分片未分配且不可用。这是一种关键状态,部分数据无法读写,并有部分数据丢失的风险。(YELLOW 表示仅副本未分配;主分片完好。)
原因
节点崩溃/离开,其上的主分片没有副本可用、分配被磁盘水位线阻止、分片损坏、快照恢复期间出错,或分配设置阻止了分片分配。
解决方法
查看分片未分配的原因:GET _cluster/allocation/explain 或 GET _cat/shards?v&h=index,shard,prirep,state,unassigned.reason。恢复崩溃的节点;如果是磁盘问题,释放空间(水位线)。如果分配被暂时阻止,触发重新分配:POST _cluster/reroute?retry_failed=true。如果主分片完全丢失,从快照恢复。在 RED 状态下,首先集中精力恢复主分片。
同一数据库的其他条目
- document_missing_exceptiondocument_missing_exception: [_doc][id]: document missing(文档不存在)
- index_not_found_exceptionindex_not_found_exception: no such index [index_name] (HTTP 404)(索引不存在)
- resource_already_exists_exceptionresource_already_exists_exception: index [index_name/uuid] already exists (HTTP 400)(索引已存在)
- no_shard_available_action_exceptionno_shard_available_action_exception: No shard available for [...](没有可用的分片)
- es_rejected_execution_exceptiones_rejected_execution_exception: rejected execution of ... on ... (queue capacity ...) (HTTP 429)(线程池队列已满,执行被拒绝)
- master_not_discovered_exceptionmaster_not_discovered_exception / MasterNotDiscoveredException(未发现 master 节点)
- security_exceptionsecurity_exception: unable to authenticate / action [...] is unauthorized for user [...] (HTTP 401/403)(无法认证 / 用户无权执行该操作)