The cluster APIs
These APIs allow us to know about cluster state, health, statistics, node statistics, node information, and so on.
Cluster health
To know cluster health, we can use the _cluster
/health
endpoint, as shown in the following example:
GET /_cluster/health/library
Here, GET
is the verb, _cluster/health
is the endpoint, and library
is the index. This call will result in information about nodes, data nodes, shards, tasks, and status of the index in case the index was specified otherwise for the cluster:
The results on the Response pane show the status of the Elasticsearch cluster as green with other values such as node information, shards, and pending tasks.
Let's have a look at what other values of the Elasticsearch status denote:
- Red: Some or all of the primary shards are not allocated or ready
- Yellow: All primary shards are allocated, but some or none of the replica shards are allocated
- Green: All primary and replica shards are allocated and the cluster is fully up
Tip
If...