WARNING: The 2.x versions of Elasticsearch have passed their EOL dates. If you are running a 2.x version, we strongly advise you to upgrade.
This documentation is no longer maintained and may be removed. For the latest information, see the current Elasticsearch documentation.
Cluster Healthedit
Many statistics can be monitored in an Elasticsearch cluster,
but the single most important one is cluster health, which reports a
status
of either green
, yellow
, or red
:
GET /_cluster/health
On an empty cluster with no indices, this will return something like the following:
{ "cluster_name": "elasticsearch", "status": "green", "timed_out": false, "number_of_nodes": 1, "number_of_data_nodes": 1, "active_primary_shards": 0, "active_shards": 0, "relocating_shards": 0, "initializing_shards": 0, "unassigned_shards": 0 }
The status
field provides an overall indication of how the cluster is
functioning. The meanings of the three colors are provided here for reference:
-
green
- All primary and replica shards are active.
-
yellow
- All primary shards are active, but not all replica shards are active.
-
red
- Not all primary shards are active.
In the rest of this chapter, we explain what primary and replica shards are and explain the practical implications of each of the preceding colors.