elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.23k stars 24.85k forks source link

(API) Cluster Health report unassigned_primary_shards #111727

Closed stefnestor closed 2 months ago

stefnestor commented 3 months ago

Description

👋 howdy, team!

Will you kindly consider having the Allocation Cluster Health API also report unassigned_primary_shards on top of unassigned_shards to better summarize a status:red?

E.g. under - I would suspect a node-level/higher issue but under + I would suspect an index-level.

{
  "cluster_name": "abea12cb73c74d1e994e3d23cff1340c",
  "status": "red",
  "timed_out": false,
  "number_of_nodes": 15,
  "number_of_data_nodes": 10,
  "active_primary_shards": 1895,
  "active_shards": 2294,
  "relocating_shards": 0,
  "initializing_shards": 2,
  "unassigned_shards": 62,
-  "unassigned_primary_shards": 62,
+  "unassigned_primary_shards": 1,
  "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": 97.28583545377438
}

Obviously next step is still run Allocation Explain, but this would let you quick check amount of shards you potentially have to review to resolve red > yellow status before you start manually reading through CAT Shards to find a shard to check.

elasticsearchmachine commented 3 months ago

Pinging @elastic/es-data-management (Team:Data Management)