简而言之,当 Elasticsearch 在复制索引后无法获取索引版本时,就会出现此错误。这可能是由于文件系统问题、网络连接不稳定或权限不足导致的。要解决此问题,您可以尝试以下方法:1) 检查并修复文件系统的任何问题。2) 确保网络连接稳定。3) 验证 Elasticsearch 是否具有访问索引文件的必要权限。4) 如果错误仍然存在,考虑重新索引您的数据。
Log Context #
日志 “failed to fetch index version after copying it over” 的类名是 StoreRecovery.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些需要深入了解上下文的用户参考:
logger.trace("cleaning existing shard; shouldn't exists");
Lucene.cleanLuceneIndex(store.directory());
si = null;
}
} catch (Exception e) {
throw new IndexShardRecoveryException(shardId, "failed to fetch index version after copying it over", e);
}
if (recoveryState.getRecoverySource().getType() == RecoverySource.Type.LOCAL_SHARDS) {
assert indexShouldExists;
bootstrap(indexShard, store);
writeEmptyRetentionLeasesFile(indexShard);





