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

版本: 6.8-7.15

简要来说,当您尝试关闭 Elasticsearch 中正在进行快照的索引时,会出现此错误。快照过程需要索引保持打开状态才能成功完成。要解决此问题,您可以等待快照过程完成后再关闭索引,或者如果快照不再需要,可以手动停止快照过程。请注意,停止快照过程可能会导致快照不完整。

日志上下文 #

日志 “Cannot close indices that are being snapshotted:” 的类名是 MetadataIndexStateService.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:

}  // 检查索引关闭是否与任何正在运行的快照冲突
Set<String> snapshottingIndices = SnapshotsService.snapshottingIndices(currentState, indicesToClose);
if (snapshottingIndices.isEmpty() == false) {
    throw new SnapshotInProgressException("Cannot close indices that are being snapshotted: " + snapshottingIndices +
    ". Try again after snapshot finishes or cancel the currently running snapshot.");
}  final ClusterBlocks.Builder blocks = ClusterBlocks.builder().blocks(currentState.blocks());
final RoutingTable.Builder routingTable = RoutingTable.builder(currentState.routingTable());