アラキタウン

黒歴史や生き恥を切り売り

retrying failed action with respondse code :503 ({"type"=>"unavailable_shards_exception","reason"=>"[インデックス名][0] primary shard is not active Timeout:[1m],request:[BulkShardRequest [[インデックス名][0]] containing [] reque

logstashでDBのデータをelasticsearchに投入しようとすると、以下のエラーが起きた。
retrying failed action with respondse code :503 ({"type"=>"unavailable_shards_exception","reason"=>"[インデックス名][0] primary shard is not active Timeout:[1m],request:[BulkShardRequest [[インデックス名][0]] containing [] requests]"})
 
シャードを確認すると、他にもunassignedになっているシャードがあったりして、しばらく悩みましたが、
 
これはシャードの再配置が無効になっていたことで起きたことでした。以下で再配置を有効にすると解決しました
 
Curl –H ‘Content-Type: application/json’ –XPUT  ‘http://localhost:9200/_cluster/settings –d ‘{
  “persistent”: {
    “cluster.routing.allocation.enable” : “all”
  }
}’