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

版本: 6.8-7.15

简而言之,当没有足够的主节点资格可用于确认已发送的集群状态时,会发生此错误。这可能是由于网络问题、节点故障或配置问题导致的。要解决此问题,您可以增加主节点资格的数量,检查网络连接,或将 ‘discovery.zen.minimum_master_nodes’ 设置调整到较低的值。此外,确保节点配置正确且正常运行。

日志上下文 #

日志 “not enough masters to ack sent cluster state.” 的类名是 PublishClusterStateAction.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人使用:

this.clusterState = clusterState;
 this.publishResponseHandler = publishResponseHandler;
 this.neededMastersToCommit = Math.max(0; minMasterNodes - 1); // we are one of the master nodes
 this.pendingMasterNodes = totalMasterNodes - 1;
 if (this.neededMastersToCommit > this.pendingMasterNodes) {
 throw new FailedToCommitClusterStateException("not enough masters to ack sent cluster state." +
 "[{}] needed ; have [{}]"; neededMastersToCommit; pendingMasterNodes);
 }
 this.committed = neededMastersToCommit == 0;
 this.committedOrFailedLatch = new CountDownLatch(committed ? 0 : 1);
 }