您好,登錄后才能下訂單哦!
elasticsearch 集群indices 分片狀態INITIALIZING,集群狀態為: yellow
GET /_cat/shards/7a_cool
7a_cool 5 r STARTED 4583018 759.4mb 10.2.4.21 pt01-pte-10-2-4-21
7a_cool 17 r INITIALIZING 10.2.4.22 pt01-pte-10-2-4-22 《==異常分片
登陸pt01-pte-10-2-4-22 主機 ,/etc/init.d/elasticsearch stop ,發現分片自動遷移至其它主機,但是狀態還是在初始化狀態,問題依舊存在;
POST /_cluster/reroute
{
"commands": [
{
"move": {
"index": "7a_cool",
"shard": 17,
"from_node": "pt01-pte-10-2-4-22",
"to_node": "pt01-pte-10-2-4-25"
}
}
]
}
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "[move_allocation] can't move 17, shard is not started (state = INITIALIZING]"
}
],
"type": "illegal_argument_exception",
"reason": "[move_allocation] can't move 17, shard is not started (state = INITIALIZING]"
},
"status": 400
}
以上信息顯示, state = INITIALIZING ,不能移動。
首先修改indices 副本數為0
此時集群開始調整集群分片,調整完成后集群狀態變成:green
PUT 7a_cool/_settings
{
"index": {
"number_of_replicas": "0"
}
}
PUT 7a_cool/_settings
{
"index": {
"number_of_replicas": "1"
}
}
集群會再次調整副本數量,調整完成后集群狀態依然是:green ,問題解決。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。