--- title: "关闭索引请求未能得到确认 - 如何解决此 Elasticsearch 异常" date: 2026-01-29 lastmod: 2026-01-29 description: "当 Elasticsearch 在指定的超时期限内未收到关闭索引请求的确认时,会抛出此错误。这可能是由于网络问题、集群负载过重或特定索引存在问题导致的。" tags: ["Elasticsearch", "索引关闭", "确认超时", "集群管理", "跨集群复制"] summary: " 版本: 7.7-8.9 简而言之,当 Elasticsearch 在指定的超时期限内未收到关闭索引请求的确认时,就会发生此错误。这可能是由于网络问题、集群负载过重或特定索引存在问题导致的。要解决此问题,可以增加超时期限、确保集群未过载,或检查索引的健康状况。如果索引已损坏,可能需要从备份中恢复它。 日志上下文 # 日志"close index request failed to be acknowledged"(关闭索引请求未能得到确认)的类名是 CloseFollowerIndexStep.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考: if (indexMetadata.getState() == IndexMetadata.State.OPEN) { CloseIndexRequest closeIndexRequest = new CloseIndexRequest(followerIndex).masterNodeTimeout(TimeValue.MAX_VALUE); getClient().admin().indices().close(closeIndexRequest; ActionListener.wrap(r -> { if (r.isAcknowledged() == false) { throw new ElasticsearchException("close index request failed to be acknowledged"); } listener.onResponse(null); }; listener::onFailure)); } else { listener.onResponse(null); " --- > **版本:** 7.7-8.9 简而言之,当 Elasticsearch 在指定的超时期限内未收到关闭索引请求的确认时,就会发生此错误。这可能是由于网络问题、集群负载过重或特定索引存在问题导致的。要解决此问题,可以增加超时期限、确保集群未过载,或检查索引的健康状况。如果索引已损坏,可能需要从备份中恢复它。 ## 日志上下文 日志"close index request failed to be acknowledged"(关闭索引请求未能得到确认)的类名是 [CloseFollowerIndexStep.java](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/)。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考: ```java if (indexMetadata.getState() == IndexMetadata.State.OPEN) { CloseIndexRequest closeIndexRequest = new CloseIndexRequest(followerIndex).masterNodeTimeout(TimeValue.MAX_VALUE); getClient().admin().indices().close(closeIndexRequest; ActionListener.wrap(r -> { if (r.isAcknowledged() == false) { throw new ElasticsearchException("close index request failed to be acknowledged"); } listener.onResponse(null); }; listener::onFailure)); } else { listener.onResponse(null); ```