FULL AI ANALYSIS

Elasticsearch cluster stops relocating shards after index.routing.allocation.exclude set incorrectly

Generated Oct 20, 2026, 9:41:02 AM

Analysis summary

The allocation explain output shows the exclude filter removed eligible nodes, causing unassigned primaries. Even when cluster.routing.allocation.enable is 'all', index-level routing filters can prevent allocation. Other blockers include 'cluster.routing.allocation.exclude' left as a persistent transient setting, or index.block settings (index.blocks.write or blocks.metadata) or leftover shard allocation deciders like disk watermarks or allocation filtering at cluster level. A safe path is to examine current allocation filters, clear accidental excludes, and use reroute API or set allocation enable to 'all'. If primaries are gone and no replicas exist, recovery requires restoring from snapshot or re-adding original node.

Possible causes

Index-level allocation exclude removed all eligible target nodes (exclude pattern too broad), preventing any allocation

80%

Cluster-level allocation disabled or set to a restrictive value (cluster.routing.allocation.enable=none) preventing relocation

50%

Disk-based decider (low/high watermark) blocking allocation due to misreported free space or container filesystem showing inflated free space

40%

Index-level blocks (index.blocks.write or read-only settings) or snapshot lifecycle/ongoing snapshot preventing allocation

25%

Suggested fixes

1

Diagnostic step 1

Run GET _cluster/allocation/explain for a specific unassigned shard to read the exact allocator decision.

2

Diagnostic step 2

Inspect index and cluster allocation settings: GET /_cluster/settings?include_defaults=true and GET /<index>/_settings for index.routing.* and index.blocks.*.

3

Diagnostic step 3

If an exclude is too broad, clear it: PUT /<index>/_settings {"index.routing.allocation.exclude._name": null} (or use empty string) for affected indices. Do this for a small set of indices first.

4

Diagnostic step 4

If cluster.routing.allocation.enable was changed, set it back to 'all': PUT /_cluster/settings {"transient":{"cluster.routing.allocation.enable":"all"}}.

5

Diagnostic step 5

After fixes, monitor allocation with GET /_cluster/health and reroute if necessary (POST /_cluster/reroute with allocate_empty_primary only as last resort and only if you have a snapshot). Escalate to restore from recent snapshot if primaries cannot be recovered.