An unassigned shard is a shard that Elasticsearch has not allocated to any node. Allocation normally balances primary shards and replicas across available nodes; when allocation fails, the cluster reports the problem. section 15.3.2 section 15.3.1
Diagnose an allocation failure
Start with the allocation explanation API:\n\nGET _cluster/allocation/explain\n\nElasticsearch selects an unassigned shard when no shard details are supplied and explains why allocation failed. For one shard, identify the index, shard number, and whether it is primary:\n\nGET _cluster/allocation/explain\n{\n "index": "programming_books2",\n "shard": 0,\n "primary": true,\n "current_node": "mkmac.local"\n}\n\nInspect the deciders: a same_shard decision can reject placement when another copy already occupies the node, while disk_threshold can reject a node below its required free-space watermark. section 15.3.2
Treat unassigned shards as an operational warning or incident:
- A YELLOW cluster can indicate unassigned shards or replicas; a RED cluster requires immediate attention because part of the cluster may be unavailable. section 15.3.1
- After node failure and rebalancing, unassigned shards can halt searches and writes for an existing index; writes pause for a newly created index until allocation is fixed. section 15.3.2
- On a single-node cluster, a configured replica remains unassigned because Elasticsearch does not place a replica beside its primary copy. section 14.1.1
