正常遷移完成后啟動服務,查看ES非健康狀態
此時觀察ES集群狀態:curl -XGET -u elastic:xxx 'localhost:9200/_cluster/health?pretty'
注意到"active_shards_percent_as_number" : 88.8888 該項的值不產生變化;集群狀態"status" : “yellow”,非健康狀態
并且,此時觀察集群內各索引狀態:curl -XGET -u elastic:xxx http://localhost:9200/_cat/indices
發現一些自動生成的索引為yellow
解決方法:
刪除異常分片,首先保證集群重新正常運行
# 刪除異常索引
curl -XDELETE -u elastic:xxx 'http://localhost:9200/.monitoring-es*'例如:
# 刪除單個索引
curl -XDELETE -u elastic:xxx 'http://localhost:9200/index'
# 刪除多個索引
curl -XDELETE -u elastic:xxx 'http://localhost:9200/index_one,index_two'
之后ES集群狀態從"yellow"恢復為"green",視實際情況而定,ES集群恢復正常數據同步,當"active_shards_percent_as_number" : 的值為100時,說明數據分片完全同步。