溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

elasticsearch 集群indices 分片狀態(tài)INITIALIZING

發(fā)布時(shí)間:2020-05-24 14:12:13 來源:網(wǎng)絡(luò) 閱讀:28217 作者:無鋒劍 欄目:大數(shù)據(jù)

elasticsearch 集群indices 分片狀態(tài)INITIALIZING,集群狀態(tài)為: yellow

故障現(xiàn)象

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  《==異常分片

解決辦法

1:關(guān)閉異常分片主機(jī)es 服務(wù);

        登陸pt01-pte-10-2-4-22 主機(jī)  ,/etc/init.d/elasticsearch  stop ,發(fā)現(xiàn)分片自動(dòng)遷移至其它主機(jī),但是狀態(tài)還是在初始化狀態(tài),問題依舊存在;   

2:指定分片做主機(jī)遷移,

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"
      }
    }
  ]
}
發(fā)現(xiàn)報(bào)錯(cuò):報(bào)錯(cuò)信息如下:
{
  "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)。   

3:修改分片副本數(shù)量

    首先修改indices 副本數(shù)為0 

    此時(shí)集群開始調(diào)整集群分片,調(diào)整完成后集群狀態(tài)變成:green
PUT 7a_cool/_settings
{
  "index": {
        "number_of_replicas": "0"
        }
}
然后再修改集群indices狀態(tài)為1
PUT 7a_cool/_settings
{
  "index": {
        "number_of_replicas": "1"
        }
}
集群會(huì)再次調(diào)整副本數(shù)量,調(diào)整完成后集群狀態(tài)依然是:green ,問題解決。
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI