略微加速

Elasticsearch权威指南 - 互联网笔记

集群健康 | Elasticsearch: 权威指南 | Elastic

2024-03-28

集群健康编辑

Elasticsearch 的集群监控信息中包含了许多的统计数据,其中最为重要的一项就是 集群健康 , 它在 status 字段中展示为 greenyellow 或者 red

GET /_cluster/health

在一个不包含任何索引的空集群中,它将会有一个类似于如下所示的返回内容:

{
   "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
}

status 字段是我们最关心的。

status 字段指示着当前集群在总体上是否工作正常。它的三种颜色含义如下:

green
所有的主分片和副本分片都正常运行。
yellow
所有的主分片都正常运行,但不是所有的副本分片都正常运行。
red
有主分片没能正常运行。

在本章节剩余的部分,我们将解释什么是 分片和 副本 分片,以及上面提到的这些颜色的实际意义。

官方地址:https://www.elastic.co/guide/cn/elasticsearch/guide/current/cluster-health.html

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3