Elasticsearch cluster stops relocating shards after index.routing.allocation.exclude set incorrectly
Environment
Elasticsearch 7.9.3 cluster (3 master/data nodes on EC2) with multiple hot indices. Operator recently set index-level allocation exclude to decommission a node using dynamic cluster API.
Symptoms
Several primary shards remain UNASSIGNED after the exclude; cluster health turns yellow and some shards show 'cannot allocate because allocation is disabled by settings' in allocation explain. No node failures are shown; disk usage is healthy per df -h.
Observations
GET _cluster/allocation/explain returns 'allocation filtering: no nodes match the required criteria'. Cluster settings show index.routing.allocation.exclude._name=<node-name-pattern> applied to multiple indices; cluster.routing.allocation.enable is set to 'all'. No snapshots in progress. Attempting to set allocation enable to 'primaries' did not reassign.
Already attempted
Tried clearing index-level exclude via update settings API and forced reroute but shards stayed unassigned. Restarted a data node to force rejoin; cluster state unchanged. No recent mapping or template changes.
Question
What are the correct steps to restore shard allocation safely without data loss; what cluster settings can silently block allocation even when disk and nodes look healthy?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags