Cluster health shows if all parts of your Elasticsearch system are working well together. It helps keep your data safe and your search fast.
Why cluster health ensures reliability in Elasticsearch
GET /_cluster/health
Response example:
{
"cluster_name": "my_cluster",
"status": "green", // can be green, yellow, or red
"number_of_nodes": 3,
"active_shards": 10
}The status field shows the health: green means all is good, yellow means some replicas are not assigned but data is safe, red means some data is missing or unavailable.
You use the GET /_cluster/health API to check cluster health.
GET /_cluster/health
GET /_cluster/health/my_index
GET /_cluster/health?wait_for_status=green&timeout=30sThis command asks Elasticsearch to show the cluster health in a readable format.
curl -X GET "localhost:9200/_cluster/health?pretty"Green status means your cluster is fully reliable and all data is available.
Yellow status means your data is safe but some replicas are not assigned, so if a node fails, data might be temporarily unavailable.
Red status means some data is missing or not accessible, which can cause errors or data loss.
Cluster health tells you if your Elasticsearch system is working well.
Green means all good, yellow means caution, red means problems.
Checking cluster health helps keep your data safe and your searches fast.