--- title: "在非主节点上刷新异常检测器内存需求请求 – 如何解决此 Elasticsearch 异常" date: 2026-01-11 lastmod: 2026-01-11 description: "在 Elasticsearch 中,当在非主节点上请求刷新异常检测器的内存需求时会出现此错误。Elasticsearch 要求此类操作必须在主节点上执行。" tags: ["异常检测器", "内存管理", "主节点", "节点角色"] summary: "版本: 7.12-8.4 简而言之,当在 Elasticsearch 中的非主节点上发出刷新异常检测器内存需求的请求时,会发生此错误。Elasticsearch 要求此类操作必须在主节点上执行。要解决此问题,您可以将请求重新路由到主节点,或者将该节点更改为主节点。此外,确保您的集群健康状况为绿色,并且所有节点都已正确连接,以避免此类问题。 日志上下文 # 日志 “Request to refresh anomaly detector memory requirements on non-master node” 的类名是 MlMemoryTracker.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考: * ornullif it cannot be calculated. */ public void refreshAnomalyDetectorJobMemoryAndAllOthers(String jobId; ActionListenerlistener) { if (isMaster == false) { listener.onFailure(new NotMasterException("Request to refresh anomaly detector memory requirements on non-master node")); return; } // Skip the provided job ID in the main refresh; as we unconditionally do it at the end." --- > **版本:** 7.12-8.4 简而言之,当在 Elasticsearch 中的非主节点上发出刷新异常检测器内存需求的请求时,会发生此错误。Elasticsearch 要求此类操作必须在主节点上执行。要解决此问题,您可以将请求重新路由到主节点,或者将该节点更改为主节点。此外,确保您的集群健康状况为绿色,并且所有节点都已正确连接,以避免此类问题。 日志上下文 ----------- 日志 "Request to refresh anomaly detector memory requirements on non-master node" 的类名是 [MlMemoryTracker.java.](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考: ```java * ornullif it cannot be calculated. */ public void refreshAnomalyDetectorJobMemoryAndAllOthers(String jobId; ActionListenerlistener) { if (isMaster == false) { listener.onFailure(new NotMasterException("Request to refresh anomaly detector memory requirements on non-master node")); return; } // Skip the provided job ID in the main refresh; as we unconditionally do it at the end. // Otherwise it might get refreshed twice; because it could have both a job task and a snapshot upgrade task. ```