liveBook · Manning

Cluster health status

As explained in Elasticsearch in Action, Second Edition

An Elasticsearch cluster health status is a traffic-light state indicating whether the cluster's primary and replica shards are assigned and available.

Cluster health status is Elasticsearch’s traffic-light view of shard availability. It answers a practical first question during operations: are primary shards and replicas assigned well enough for the cluster to serve data? Check it with `GET _cluster/health`; the response reports RED, YELLOW, or GREEN. section 3.2.4 section 15.3.1

Read the status from the assignment state of shards and replicas:

  • RED means some shards are unassigned, so not all data is available for querying. This can occur transiently while a cluster starts, but in operations it requires immediate attention. section 3.2.4 section 15.3.1
  • YELLOW means all shards are assigned and active, but replicas are unassigned. The cluster remains available, yet it has manageable risk and can become RED if the issue persists. section 3.2.4 section 15.3.1
  • GREEN means every shard and replica is assigned and serving as expected; this is the desired steady state. section 3.2.4 section 15.3.1

Checking a growing virus-mutations cluster

Suppose a `virus_mutations` index uses three shards. When its first node starts, shard instantiation can leave the cluster RED. After another node joins, primary shards may be balanced while replicas remain unassigned, producing YELLOW. Once all shards and replicas are allocated, the status becomes GREEN. Use `GET _cluster/health` for structured cluster information, or `GET localhost:9200/_cat/health` for a compact text view that can be opened directly in a browser. section 3.2.4

Figure 3.11 Shards are balanced onto the new node, but replicas aren’t assigned yet (YELLOW status).

This allocation view makes YELLOW concrete: shards are balanced onto a new node, while replicas still lack assignment. section 3.2.4

Health status is a high-level signal, not a complete diagnosis. A RED cluster can follow hardware failures, network outages, filesystem corruption, or lost nodes. YELLOW can reflect lost nodes or unassigned shards and replicas. Investigate with cluster allocation and node APIs, and treat persistent YELLOW as an early warning rather than a healthy endpoint. section 15.0 section 15.3.1

Cluster health also relates to search and indexing performance. Sensible distribution of nodes, shards, and replicas, together with memory and hardware planning, supports a healthy cluster; poor architecture or maintenance can degrade performance and overall health. For production tuning, validate changes in a lab environment and seek expert guidance before changing settings. section 15.1 section 15.0

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Defines RED, YELLOW, and GREEN through shard assignment and demonstrates health endpoints, while deferring detailed root-cause diagnosis to related APIs.
Examples
Uses a three-shard virus_mutations index, node startup and joining, plus GET _cluster/health and GET localhost:9200/_cat/health.
What it assumes
Introduces traffic-light states through shard and replica assignment, using nodes, shards, and replicas as the surrounding architecture vocabulary.
What you can do after
Diagnose/debug with GET _cluster/health by distinguishing unavailable primary data from missing replicas and recognizing GREEN as the operational target.
How it connects
Connects cluster health to shards, replicas, nodes, cluster allocation, master nodes, heartbeats, search performance, and indexing performance.

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.