I'm trying to build some monitoring to avoid the errors like this: "
this cluster currently has [999]/[1000] maximum shards open
Looking at response from cluster_health I see shards in 4 categories: active / unassigned / relocating / initializing.
To monitor number of open shards as a percentage of maximum shards a cluster can have, do I need to sum all of these 4 categories up ?
Basically, are these 4 mutually exclusive and factored in while calculating open shards.
{
"status": "green",
"timed_out": false,
"number_of_nodes": 6,
"number_of_data_nodes": 3,
"discovered_master": true,
"active_primary_shards": 366,
"active_shards": 1096,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 100.0
}
Another stack overflow question around the same topic: elasticsearch - How to get number of current open shards in elsticsearch cluster? - Stack Overflow
`