2017-01-24 6 views
1

私たちは5データノードと2マスターノードを持つ弾性検索クラスタを持っています。 1つのマスタノード上のエラスティックサーチサービスは常に無効になっているため、常に1つのマスタだけがアクティブになります。今日何らかの理由で、現在のマスターノードがダウンしていました。 2番目のマスターノードでサービスを開始しました。新しいマスターに接続されているすべてのデータノード、すべてのプライマリーシャードは正常に割り当てられましたが、すべてのレプリカが割り当てられていないため、割り当てられていないシャードが約384個残っています。弾性検索マスタ惨事復旧

ここで私はそれらを割り当てるにはどうすればよいですか?

このような状況で実行するベストプラクティスと手順は何ですか?続き

は私http://es-master-node:9200/_settingsがどのように見えるかです:http://pastebin.com/mK1QBfP6

私は手動で破片を割り当てるしようとすると、私は次のエラーを取得する:

➜ Desktop curl -XPOST http://localhost:9200/_cluster/reroute\?pretty -d '{ 
    "commands": [ 
    { 
     "allocate": { 
     "index": "logstash-1970.01.18", 
     "shard": 1, 
     "node": "node-name", 
     "allow_primary": true 
     } 
    } 
    ] 
}' 
{ 
    "error" : { 
    "root_cause" : [ { 
     "type" : "illegal_argument_exception", 
     "reason" : "[allocate] allocation of [logstash-1970.01.18][1] on node {node-name}{vrVG4CBbSvubWHOzn2qfQA}{10.100.0.146}{10.100.0.146:9300}{master=false} is not allowed, reason: [YES(allocation disabling is ignored)][NO(more than allowed [85.0%] used disk on node, free: [13.671127301258165%])][YES(shard not primary or relocation disabled)][YES(target node version [2.2.0] is same or newer than source node version [2.2.0])][YES(no allocation awareness enabled)][YES(shard is not allocated to same node or host)][YES(allocation disabling is ignored)][YES(below shard recovery limit of [2])][YES(total shard limit disabled: [index: -1, cluster: -1] <= 0)][YES(node passes include/exclude/require filters)][YES(primary is already active)]" 
    } ], 
    "type" : "illegal_argument_exception", 
    "reason" : "[allocate] allocation of [logstash-1970.01.18][1] on node {node-name}{vrVG4CBbSvubWHOzn2qfQA}{10.100.0.146}{10.100.0.146:9300}{master=false} is not allowed, reason: [YES(allocation disabling is ignored)][NO(more than allowed [85.0%] used disk on node, free: [13.671127301258165%])][YES(shard not primary or relocation disabled)][YES(target node version [2.2.0] is same or newer than source node version [2.2.0])][YES(no allocation awareness enabled)][YES(shard is not allocated to same node or host)][YES(allocation disabling is ignored)][YES(below shard recovery limit of [2])][YES(total shard limit disabled: [index: -1, cluster: -1] <= 0)][YES(node passes include/exclude/require filters)][YES(primary is already active)]" 
    }, 
    "status" : 400 
} 

任意のヘルプは理解されるであろう。

スポーン5個の新しいES-DATAサーバとそれらがクラスタに参加するのを待っ:

答えて

0

だから、ここで私は未割り当ての破片を割り当てるためにやった事があります。クラスタに入ったら、次のスクリプトを使用しました。

#!/bin/bash 
array=(node1 node2 node3 node4 node5) 
node_counter=0 
length=${#array[@]} 
IFS=$'\n' 
for line in $(curl -s 'http://ip-adress:9200/_cat/shards'| fgrep UNASSIGNED); do 
    INDEX=$(echo $line | (awk '{print $1}')) 
    SHARD=$(echo $line | (awk '{print $2}')) 
    NODE=${array[$node_counter]} 
    echo $NODE 
    curl -XPOST 'http://IP-adress:9200/_cluster/reroute' -d '{ 
     "commands": [ 
     { 
      "allocate": { 
       "index": "'$INDEX'", 
       "shard": '$SHARD', 
       "node": "'$NODE'", 
       "allow_primary": true 
      } 
     } 
     ] 
    }' 
    node_counter=$(((node_counter)%length +1)) 
done 

新しいデータノードに割り当てられていないシャードを割り当てます。クラスタが再び復旧するには約5〜6かかりました。これはハックですが、関連する答えが理にかなっています。

未回答の質問は次のとおりです。

  • 破片が古いノードですでにありましたが、なぜES-マスターはそれを実現したのですか?
  • は、我々は明示的に(、彼らの現在の状態について、彼らが持っているレプリカ、それらに含まれる破片など)既存のデータノードをスキャンし、それらから情報を取得するために
をES-MASTERを依頼するにはどうすればよいです