elasticsearch resource_error ai_generated partial

集群健康状态: RED, 未分配分片=5, 原因=由于机架感知约束导致分配失败

ClusterHealthResponse: status=RED, unassigned_shards=5, reason=ALLOCATION_FAILED due to [1] shards not allocated because of rack awareness constraints

ID: elasticsearch/primary-shard-not-allocated-due-to-rack-awareness

其他格式: JSON · Markdown 中文 · English
78%修复率
85%置信度
1证据数
2024-03-15首次发现

版本兼容性

版本状态引入弃用备注
7.17.10 active — — —
8.11.0 active — — —
8.12.2 active — — —

根因分析

机架感知分配过滤阻止主分片分配,因为所需机架中没有节点具有足够的磁盘空间或可用。

English

Rack awareness allocation filtering prevents primary shard allocation because no node in the required rack has enough disk space or is available.

generic

官方文档

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#cluster-allocation-awareness

解决方案

  1. 临时禁用机架感知分配过滤:PUT _cluster/settings { "transient": { "cluster.routing.allocation.awareness.attributes": "" } },分片分配后再重新启用
  2. 在所需机架中添加一个节点并确保其有足够的磁盘空间,然后使用集群重路由API:POST _cluster/reroute?retry_failed=true

无效尝试

常见但无效的做法:

  1. 65% 失败

    The issue is not overall disk space but the specific rack's node availability; increasing space on nodes in other racks does not satisfy the allocation filter

  2. 80% 失败

    Re-creating the index with fewer shards does not address the rack awareness constraint; the new primary shards will still fail to allocate if the same rack is unavailable