elasticsearch 集群indices 分片狀態(tài)INITIALIZING,集群狀態(tài)為: yellow
創(chuàng)新互聯(lián)專注于網(wǎng)站建設(shè),為客戶提供成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)開發(fā)服務(wù),多年建網(wǎng)站服務(wù)經(jīng)驗(yàn),各類網(wǎng)站都可以開發(fā),成都品牌網(wǎng)站建設(shè),公司官網(wǎng),公司展示網(wǎng)站,網(wǎng)站設(shè)計(jì),建網(wǎng)站費(fèi)用,建網(wǎng)站多少錢,價(jià)格優(yōu)惠,收費(fèi)合理。
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 主機(jī) ,/etc/init.d/elasticsearch stop ,發(fā)現(xiàn)分片自動(dòng)遷移至其它主機(jī),但是狀態(tài)還是在初始化狀態(tài),問題依舊存在;
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 ,不能移動(dòng)。
首先修改indices 副本數(shù)為0
此時(shí)集群開始調(diào)整集群分片,調(diào)整完成后集群狀態(tài)變成:green
PUT 7a_cool/_settings
{
"index": {
"number_of_replicas": "0"
}
}
PUT 7a_cool/_settings
{
"index": {
"number_of_replicas": "1"
}
}
集群會(huì)再次調(diào)整副本數(shù)量,調(diào)整完成后集群狀態(tài)依然是:green ,問題解決。