Elasticsearch 分片错误failed shard recovery解决办法

Elasticsearch 分片错误failed shard recovery解决办法

今天早上Elasticsearch莫名奇怪的报错了。整个控制台不停的打印

[2016-06-07 08:55:00,976][WARN ][indices.cluster ] [secilog] [[seci-201
606][1]] marking and sending shard failed due to [failed recovery]

org.elasticsearch.index.gateway.IndexShardGatewayRecoveryException: [seci-201606
][1] failed recovery at org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexS
hardGatewayService.java:162)

[2016-06-07 08:40:41,967][WARN ][cluster.action.shard ] [secilog] [seci-201606][1] received shard failed for [seci-201606][1], node[xGIRwM34TdWcKgV95BI74g], [P], s[INITIALIZING], indexUUID [t75Egn6rT2WyBYQk_2X3IQ], reason [shard failure [failed recovery][IndexShardGatewayRecoveryException[[seci-201606][1] failed recovery]; nested: EngineCreationFailureException[[seci-201606][1] failed to create engine]; nested: CorruptIndexException[codec footer mismatch: actual footer=-464453631 vs expected footer=-1071082520 (resource: MMapIndexInput(path="D:secislandsecilogelasticsearchdata192.168.21.5odesindicesseci-2016061index\_6exw.cfs"))]; ]]

通过错误内容大概可以看出是数据的一个分片出了问题。这个问题的解决在网上比较少,特在此介绍一下。

检查:localhost:9200/_cluster/health

从内容上可以看出有红色的状态,表示出了比较严重的问题。

题解决:

先停掉Elasticsearch。

转到Elasticsearch的lib目录

在目录下执行java -cp lucene-core-4.10.4.jar -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex D:secislandsecilogelasticsearchdata192.168.21.5odesindicesseci-2016061index -fix

然后重启看下是否好了。如果还没有好可以再次停掉Elasticsearch。

到D:secislandsecilogelasticsearchdata192.168.21.5odesindicesseci-2016061ranslog目录。

删掉里面的*.recovery文件

然后重启Elasticsearch。

这样就解决了分片损坏的问题。

赛克蓝德(secisland)版权所有,转载须保留出处。

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部