liveBook · Manning

Unassigned shard

As explained in Elasticsearch in Action, Second Edition

An unassigned shard is a shard that has not been allocated to an Elasticsearch node.

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

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains shard placement, operational impact, and allocation diagnosis, but stops short of prescribing a complete remediation procedure.
Examples
Uses a five-node, ten-shard allocation scenario, a single-node replica case, and allocation-explanation API responses.
What it assumes
Assumes basic familiarity with Elasticsearch indexes, nodes, primary shards, replicas, and cluster health.
What you can do after
Diagnose unassigned shards via the allocation-explanation API and interpret decider results affecting node placement.
How it connects
Connects unassigned shards to cluster health, replicas, shard allocation, rebalancing, node failure, and disk thresholds.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elasticsearch in Action, Second Edition. The section links point to the parts of the book it draws on.