天天看點

ES06--elasticsearch unassigned錯誤解決(手動處理)

檢視叢集健康狀态:curl -XGET http://localhost:9200/_cluster/health\?pretty

ES06--elasticsearch unassigned錯誤解決(手動處理)

圖中顯示,有0個分片未配置設定節點

*****************************開始修複************************************

1、檢視所有分片狀态:curl -XGET http://localhost:9200/_cat/shards (顯示所有分片狀态);curl -s "http://localhost:9200/_cat/shards" | grep UNASSIGNED (隻顯示為配置設定節點)

ES06--elasticsearch unassigned錯誤解決(手動處理)

2、檢視master節點的唯一辨別:curl 'localhost:9200/_nodes/process?pretty'

ES06--elasticsearch unassigned錯誤解決(手動處理)

3、執行reroute(分多次,逐個修複 變更shard的值為UNASSIGNED查詢結果中編号, 上一步查詢結果是/0 1 2 3 4)

inde:需要修複的索引的名字(這裡需要修複三個索引)

shard:shard的編号,圖中可以看出

node:master節點的唯一辨別

curl -XPOST 'localhost:9200/_cluster/reroute' -d '{

"commands" : [ {

"allocate" : {

"index" : "rs_wx_test",//UNASSIGNED 的index名稱(第一列)

"shard" : 1,//查詢出UNASSIGNED 的數字編号(第二列)

"node" : "TEEPHeoGRIurYdO8DBjJmA",

"allow_primary" : true

}

}

] }'

繼續閱讀