--- title: "取消关注请求未能被确认 - 如何解决此 Elasticsearch 异常" date: 2026-01-13 lastmod: 2026-01-13 description: "Elasticsearch 中取消关注请求未能被确认的错误及其解决方案" tags: ["Elasticsearch", "异常处理", "跨集群复制", "取消关注"] summary: "版本: 7.12-8.9 简而言之,当 Elasticsearch 的取消关注请求未被关注者索引确认时,会发生此错误。这可能是由于网络问题、关注者索引负载过高或关注者索引不可用造成的。要解决此问题,您可以尝试以下方法:1) 检查主索引和关注者索引之间的网络连接。2) 监控关注者索引的负载,必要时扩展资源。3) 确保关注者索引可用且正常运行。4) 过一段时间后重试取消关注请求。 日志上下文 # 日志 “unfollow request failed to be acknowledged” 的类名是 UnfollowFollowerIndexStep.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入理解的人参考: @Override void innerPerformAction(String followerIndex; ClusterState currentClusterState; ActionListenerlistener) { UnfollowAction.Request request = new UnfollowAction.Request(followerIndex).masterNodeTimeout(TimeValue.MAX_VALUE); getClient().execute(UnfollowAction.INSTANCE; request; ActionListener.wrap(r -> { if (r.isAcknowledged() == false) { throw new ElasticsearchException("unfollow request failed to be acknowledged"); } listener.onResponse(null); }; exception -> { if (exception instanceof ElasticsearchException e && e.getMetadata("es.failed_to_remove_retention_leases") !" --- > **版本:** 7.12-8.9 简而言之,当 Elasticsearch 的取消关注请求未被关注者索引确认时,会发生此错误。这可能是由于网络问题、关注者索引负载过高或关注者索引不可用造成的。要解决此问题,您可以尝试以下方法:1) 检查主索引和关注者索引之间的网络连接。2) 监控关注者索引的负载,必要时扩展资源。3) 确保关注者索引可用且正常运行。4) 过一段时间后重试取消关注请求。 日志上下文 ----------- 日志 "unfollow request failed to be acknowledged" 的类名是 [UnfollowFollowerIndexStep.java.](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入理解的人参考: ```java @Override void innerPerformAction(String followerIndex; ClusterState currentClusterState; ActionListenerlistener) { UnfollowAction.Request request = new UnfollowAction.Request(followerIndex).masterNodeTimeout(TimeValue.MAX_VALUE); getClient().execute(UnfollowAction.INSTANCE; request; ActionListener.wrap(r -> { if (r.isAcknowledged() == false) { throw new ElasticsearchException("unfollow request failed to be acknowledged"); } listener.onResponse(null); }; exception -> { if (exception instanceof ElasticsearchException e && e.getMetadata("es.failed_to_remove_retention_leases") != null) { ListleasesNotRemoved = e.getMetadata("es.failed_to_remove_retention_leases"); ```