1. 查看ES集群健康狀態
http://localhost:9200/_cluster/health?pretty
響應:
{
"cluster_name" : "if2c",
"status" : "yellow", //集群的狀態紅綠燈,綠:健康,黃:亞健康,紅:病態
"timed_out" : false,
"number_of_nodes" : 1, //節點數
"number_of_data_nodes" : 1, //數據節點數
"active_primary_shards" : 3, //分片數,3個Index庫
"active_shards" : 3,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 3 //未指定節點,配置了復本,僅使用一台機器部署會出現這種情況
}
查看指定索引庫的健康狀態
http://localhost:9200/_cluster/health/index_name?pretty
http://localhost:9200/_cluster/health/index_name,index_name2?pretty