查看集群状态各个指标
curl http://localhost:9200/_cluster/health?pretty
“cluster_name” : “my-application”, #集群名
“status” : “green”, #集群健康状态,正常的话是“green”,缺少副本分片为“yellow”,缺少主分片为“red”
“timed_out” : false,
“number_of_nodes” : 2, #集群节点数
“number_of_data_nodes” : 2, #数据节点数
“active_primary_shards” : 138, #主分片数
“active_shards” : 274, #可用的分片数
“relocating_shards” : 0, #正在迁移的分片数
“initializing_shards” : 0, #正在初始化的分片数
“unassigned_shards” : 0, #未分配的分片,但在集群中存在
“delayed_unassigned_shards” : 0, #延时待分配到具体节点上的分片数
“number_of_pending_tasks” : 0, #待处理的任务数,指主节点创建索引并分配shards等任务
“number_of_in_flight_fetch” : 0,
“task_max_waiting_in_queue_millis” : 0,
“active_shards_percent_as_number” : 100.0 #可用分片数占总分片的比例
出现黄色说明副本分片出现问题本人解决办法
curl -H “Content-Type: application/json” -XPUT “http://192.168.6.189:9200/_settings” -d’ {“number_of_replicas”:0}’