At a glance
The count of shards the cluster is currently moving into place: shards in theINITIALIZINGstate (being created, recovered, or restored) plus shards in theRELOCATINGstate (being moved from one node to another). A small, transient number is completely normal: it is the cluster rebalancing itself. A number that stays elevated for ten minutes or more is the signal that recovery is stuck or that a rebalance is thrashing, which steals disk IO and network bandwidth from search and indexing. For a DBA, this card answers “is my cluster settling, or is it churning?”
Calculation
The headline value is a direct sum from cluster health:GET /_cluster/health call, which the cluster computes from its routing table. The alert logic adds a duration guard: the value must exceed 5 and remain above 5 continuously for 10 minutes before the alert fires. This duration gate is deliberate. Shards move constantly on a healthy cluster: a node restart, an ILM rollover, or a manual reindex all briefly push the count up, then it drains as recovery completes. Alerting on the instantaneous value would page on every routine operation.
The card separates the two components in the detail view so you can tell churn types apart. A high relocating_shards count points to the balancer actively moving data (often after adding or draining a node, or after a disk watermark forced relocation). A high initializing_shards count points to recovery (a replica rebuilding after a node rejoined, or a snapshot restore in progress). The two have different remedies, so keeping them distinct matters.
Worked example
A platform team operates an 8-node Elasticsearch cluster supporting a marketplace search index with 40 primary shards and 1 replica each (80 shards total). One data node, es-data-5, hits a hardware fault and is fenced out at 09:02 BST on 22 Apr 26. The cluster reacts: the 10 shards that lived on es-data-5 are now under-replicated, and after the index-leveldelayed_timeout (default 1 minute) expires, the allocator begins rebuilding their missing copies on the remaining nodes.
The alert fired at 09:13 (count above 5 sustained for the full 10-minute window). The on-call DBA’s read:
max_bytes_per_sec on a multi-gigabyte rebuild. The team temporarily raised the throttle, the backlog drained faster, and the cluster returned to GREEN by 09:41. No data was lost because all primaries stayed allocated throughout.
Three takeaways for an ops team:
- In-motion is healthy; stuck is not. The number going up is rarely the problem. The number staying up is the problem. That is exactly why the alert has a 10-minute sustain gate rather than firing on the raw value.
- Initializing and relocating need different responses. Stuck relocations usually mean a disk watermark or allocation filter is blocking placement; stuck initialisations usually mean recovery is throttled or a node is flapping. Read the split, not just the sum.
- Pair it with status and unassigned shards. This card shows movement; Unassigned Shards shows shards that are not even moving yet, and Cluster Status (green / yellow / red) shows whether any data is actually unavailable. Together they tell you whether you are watching a normal recovery or a real outage.
Sibling cards
Reconciling against the source
Where to look in Elasticsearch’s own tooling:Why our number may legitimately differ from a raw health read:GET /_cluster/healthreturnsinitializing_shardsandrelocating_shardsdirectly; the sum is the headline.GET /_cat/shards?v&h=index,shard,prirep,state,nodelists every shard and its state, so you can see exactly which indices are mid-recovery.GET /_cat/recovery?v&active_only=trueshows live recovery progress with bytes and percentage complete, the fastest way to tell “moving slowly” from “stuck at 0%”.GET /_cluster/allocation/explainexplains why a specific shard cannot be allocated when relocation is blocked. On Elastic Cloud, Stack Monitoring shows shard activity per index; on AWS OpenSearch, the CloudWatch metricsRelocatingShardsandInitializingShardsmirror these counters.
Cross-connector reconciliation: sustained shard movement that coincides with a search latency spike means recovery is competing with query traffic for IO. Compare with Search Latency p95 (ms); if p95 climbs in lock-step with shards in motion, throttle recovery during business hours.
Known limitations / FAQs
Is a non-zero count a problem? No. A small, transient count is healthy: the cluster is rebalancing, recovering a replica, or completing a rollover. The alert only fires when the count exceeds 5 and stays there for 10 minutes, because a sustained backlog is the signal that recovery is stuck or thrashing. What is the difference between initializing and relocating?INITIALIZING shards are being built or recovered from scratch (a new replica, a snapshot restore, a primary recovering from its translog). RELOCATING shards already exist and are being moved from one node to another by the allocation balancer. They have different causes and different fixes, which is why the detail view splits them.
The count is stuck and recovery shows 0% progress. What now?
Run GET /_cluster/allocation/explain. The most common blockers are a disk high watermark (the target node is too full to accept the shard), an allocation filter or awareness rule preventing placement, or a node version mismatch during an upgrade. The explain output names the exact reason per shard.
Why does this card stay quiet when a shard is unassigned?
Unassigned shards are waiting, not moving, so they do not count here. They have their own card, Unassigned Shards, which is the more urgent signal because unassigned primaries mean data is unavailable.
A rolling restart pushed this above 5. Should I worry?
Briefly, no. A rolling restart deliberately moves shards as each node leaves and rejoins; a short spike above 5 is expected and self-clears once recovery completes. The 10-minute sustain gate is designed so routine restarts do not page you. If it stays high well past the restart window, then investigate.
Does high shard movement slow down search?
It can. Recovery and relocation consume disk IO, CPU, and network bandwidth that would otherwise serve queries. If you see search latency rise alongside a recovery backlog, lower indices.recovery.max_bytes_per_sec to cap the impact during business hours, or schedule large rebalances for off-peak.
Can I make recovery finish faster?
Yes, within limits. Raising indices.recovery.max_bytes_per_sec and cluster.routing.allocation.node_concurrent_recoveries lets more shards move at once and each move faster, at the cost of more load on the cluster. Raise it to drain a backlog quickly, then return to defaults so the next routine recovery does not overwhelm live traffic.