Q:非洲食人族的酋长吃什么?

ES6.8版本,分片恢复失败

Elasticsearch | 作者 yimusidian | 发布于2022年01月10日 | 阅读数:1589

各位大佬们,这个问题有遇到过吗?
报错日志:failed shard on node [p6BGCmYGSlWO1QvlDQObBw]: failed recovery, failure RecoveryFailedException[[eve20211230_v9][4]: Recovery failed on {p6BGCmY}{p6BGCmYGSlWO1QvlDQObBw}{8Eh-adgRTHi6UnApQSZP4g}{127.0.0.1}{127.0.0.1:31700}{xpack.installed=true}]; nested: IndexShardRecoveryException[failed to fetch index version after copying it over]; nested: CorruptIndexException[verification failed : calculated=1mz0sst stored=1y76rc8 (resource=VerifyingIndexInput(MMapIndexInput(path=\"/data/secfoxlas/misc/arkbase-2/data/nodes/0/indices/MaGUiuWsSIumOsPycScR7g/4/index/_k0c.cfs\")))];
已邀请:

just_finy - 一个simple的运维

赞同来自: caster_QL

可以用org.apache.lucene.index.CheckIndex 修复损坏的段 丢失部分数据
 
1. 关闭索引 
2. 找到分片所在主机及对应的目录 (curl localhost:9200/_cat/indices | grep myindex 把索引ID找到)
3. 修复损坏的段(丢弃损坏段的数据)
cd elasticsearch/lib/
java -cp lucene-core*.jar -ea:org.apache.lucene… org.apache.lucene.index.CheckIndex /var/lib/elasticsearch/nodes/0/indices/F_s-K-1YSFmmZOa3Z4ZMig/1/index -verbose -exorcise
cd /var/lib/elasticsearch/nodes/0/indices/F_s-K-1YSFmmZOa3Z4ZMig/1/index
rm -f corrupted_*

4. 打开索引
5. 执行迁移 node为目前数据存在的主机
 
POST /_cluster/reroute
{
"commands": [
{
"allocate_stale_primary":
{
"index": "myindex",
"shard": 2
"node": "node2",
"accept_data_loss": true
}
}
]
}


 

caster_QL

赞同来自:

应该是磁盘坏了吧,查一下磁盘,如果坏了,有副本可以提升副本为主分片,没有也可以将分片置空。
也可以尝试一下es bin目录下自带的修复命令 elasticsearch-shard
可以参考一下这篇文章,希望对你有帮助:https://www.jianshu.com/p/ffe4761dc79a

要回复问题请先登录注册