--- title: "仅在未进行重新配置时才允许重新配置——如何解决此 Elasticsearch 异常" date: 2026-02-17 lastmod: 2026-02-17 description: "此错误发生在尝试重新配置 Elasticsearch 时,而它已经处于重新配置过程中。这会导致不一致和错误。解决方法是等待当前重新配置过程完成后再启动新的配置过程。" tags: ["重新配置", "异常处理", "集群状态"] summary: " 版本: 7-8.9 简而言之,当尝试在 Elasticsearch 已经处于重新配置过程中时再次进行重新配置,就会发生此错误。这是不允许的,因为它可能导致不一致和错误。要解决此问题,您可以在启动新的重新配置之前等待当前重新配置过程完成,或者可以停止当前的重新配置过程,然后启动新的重新配置。此外,重要的是要确保自动化进程或脚本不会同时尝试重新配置 Elasticsearch。 日志上下文 # 日志"only allow reconfiguration while not already reconfiguring"的类名是 CoordinationState.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用: ); } if (electionStrategy.isInvalidReconfiguration(clusterState; getLastAcceptedConfiguration(); getLastCommittedConfiguration())) { logger.debug("handleClientValue: only allow reconfiguration while not already reconfiguring"); throw new CoordinationStateRejectedException("only allow reconfiguration while not already reconfiguring"); } if (joinVotesHaveQuorumFor(clusterState.getLastAcceptedConfiguration()) == false) { logger.debug("handleClientValue: only allow reconfiguration if joinVotes have quorum for new config"); throw new CoordinationStateRejectedException("only allow reconfiguration if joinVotes have quorum for new config"); } " --- > **版本:** 7-8.9 简而言之,当尝试在 Elasticsearch 已经处于重新配置过程中时再次进行重新配置,就会发生此错误。这是不允许的,因为它可能导致不一致和错误。要解决此问题,您可以在启动新的重新配置之前等待当前重新配置过程完成,或者可以停止当前的重新配置过程,然后启动新的重新配置。此外,重要的是要确保自动化进程或脚本不会同时尝试重新配置 Elasticsearch。 日志上下文 ----------- 日志"only allow reconfiguration while not already reconfiguring"的类名是 [CoordinationState.java。](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用: ```java ); } if (electionStrategy.isInvalidReconfiguration(clusterState; getLastAcceptedConfiguration(); getLastCommittedConfiguration())) { logger.debug("handleClientValue: only allow reconfiguration while not already reconfiguring"); throw new CoordinationStateRejectedException("only allow reconfiguration while not already reconfiguring"); } if (joinVotesHaveQuorumFor(clusterState.getLastAcceptedConfiguration()) == false) { logger.debug("handleClientValue: only allow reconfiguration if joinVotes have quorum for new config"); throw new CoordinationStateRejectedException("only allow reconfiguration if joinVotes have quorum for new config"); } ```