首页/数据/NoSQL 速查/集群健康 _cluster/health
本包目录(322 条)
MongoDB99 条
Elasticsearch89 条
ClickHouse56 条时序与列式28 条选型与架构50 条

集群健康 _cluster/health

集群健康接口返回状态色、节点与分片计数:green 表示主副本齐全,yellow 表示副本未分配,red 表示存在主分片未分配;可带 wait_for_status 做等待。

NoSQL 速查数据更新于 2026-10-12
接口GET /_cluster/health
关键字段status、number_of_nodes、active_shards、relocating_shards、unassigned_shards、number_of_pending_tasks
常用参数wait_for_status=yellow、wait_for_no_relocating_shards、timeout

示例

示例
GET /_cluster/health?pretty
GET /_cluster/health?wait_for_status=yellow&timeout=30s
GET /_cluster/health/logs-*?level=indices
red 时先看 unassigned_shards 与后续的 allocation explain,判断是节点掉线、磁盘水位还是分片损坏。

易错点

  • health 只反映分片分配,不代表查询都正常:线程池拒绝、断路器触发时状态仍可能是 green
  • 带 wait_for 的请求最长会阻塞到 timeout,监控探针要设置合理超时

数据来源与参考

  • Elasticsearch Guide: Cluster health API
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌