📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 7.8-8.9

简而言之,当 Elasticsearch 无法在给定仓库中找到指定的快照时,会发生此错误。这可能是由于快照被删除、重命名或一开始就不存在。要解决此问题,您可以验证快照名称和仓库名称是否存在拼写错误或大小写敏感问题。如果快照已被删除,您可能需要重新创建它。如果它被重命名了,请使用更新后的名称。最后,确保快照确实存在于您引用的仓库中。

日志上下文 #

日志 “snapshot [” + snapName + “] not found in repository [” + repoName + “]” 类名是 TransportMountSearchableSnapshotAction.java。 我们从 Elasticsearch 源代码中提取了以下内容,为那些寻求深入上下文的人:

final OptionalmatchingSnapshotId = repoData.getSnapshotIds()
 .stream()
 .filter(s -> snapName.equals(s.getName()))
 .findFirst();
 if (matchingSnapshotId.isEmpty()) {
 throw new ElasticsearchException("snapshot [" + snapName + "] not found in repository [" + repoName + "]");
 }
 final SnapshotId snapshotId = matchingSnapshotId.get();  final IndexMetadata indexMetadata = repository.getSnapshotIndexMetaData(repoData; snapshotId; indexId);
 if (indexMetadata.isSearchableSnapshot()) {