Elasticsearch错误-群集运行状况从[黄色]变为[红色](原因:[分片失败

时间:2018-08-31 11:17:34

标签: elasticsearch sharding

我正在使用elasticdump通过命令elasticdump --input=./xyz.json --output=http://localhost:9200/将巨大的数据集转储到Elasticsearch节点中。一切正常,但是一段时间后,我在控制台中看到以下错误消息:

_type: 'doc',
_id: 'lzHMQmUBQ1VCv6VBROQA',
status: 503,
error:
{ type: 'unavailable_shards_exception',
 reason: '[logstash-2018.08.16][2] primary shard is not active Timeout: 
[1m], request: [BulkShardRequest [[logstash-2018.08.16][2]] containing [31] requests]' } }

在检查Elasticsearch日志时,可以看到以下错误:

[2018-08-31T11:27:21,496][INFO ][o.e.c.r.a.AllocationService] [dqSwClD] Cluster health status changed from [YELLOW] to [RED] (reason: [shards failed [[logstash-2018.08.16][2]] ...]).

我不确定shard failure的起因是什么,并且一些故障排除工作都证明是无效的。

1 个答案:

答案 0 :(得分:0)

您可以在https://www.elastic.co/guide/en/elasticsearch/reference/master/tune-for-indexing-speed.html上找到许多优化批量索引的技巧:

  • 禁用副本
  • 禁用几乎实时的刷新(索引的refresh_interval
  • 等...