Elasticsearch- 集羣狀態查詢

1. 查看ES集羣健康狀態

curl -XGET 'http://localhost:8200/_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  //未指定節點,配置了複本,僅使用一臺機器部署會出現這種情況
}

也可以對具體Index庫(一個或者多個庫)進行查看健康狀態

curl -XGET 'http://localhost:8200/_cluster/health/zh?pretty' 一個index庫
curl -XGET 'http://localhost:8200/_cluster/health/zh,west?pretty' 多個index庫

也可以附加一些參數顯示更加具體的內容

level=indices, shards, cluster

curl -XGET 'http://localhost:8200/_cluster/health?level=indices&pretty'
curl -XGET 'http://localhost:8200/_cluster/health?level=shards&pretty'
發佈了103 篇原創文章 · 獲贊 9 · 訪問量 40萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章