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

版本: 7.11-7.13

简要来说,当您尝试向已达到快照数量上限的Elasticsearch仓库添加新快照时,会发生此错误。Elasticsearch对每个仓库配置了快照数量限制,当快照数量达到此限制时,将无法添加更多快照。

要解决此问题,您可以:

  1. 删除旧的快照以释放空间
  2. 修改仓库配置,增加允许的快照数量上限
  3. 创建一个新的仓库并将快照添加到那里

日志上下文 #

日志"Cannot add another snapshot to this repository as it"的类名是 BlobStoreRepository.java。我们从Elasticsearch源代码中提取了以下内容,供那些需要深入上下文的用户参考:

final StepListener<RepositoryData> repoDataListener = new StepListener<>();
getRepositoryData(repoDataListener);
repoDataListener.whenComplete(existingRepositoryData -> {
    final int existingSnapshotCount = existingRepositoryData.getSnapshotIds().size();
    if (existingSnapshotCount >= maxSnapshotCount) {
        listener.onFailure(new RepositoryException(metadata.name(), "Cannot add another snapshot to this repository as it " +
        "already contains [" + existingSnapshotCount + "] snapshots and is configured to hold up to [" + maxSnapshotCount +
        "] snapshots only."));
        return;
    }