我正在尝试自动化 kubernetes 集群中弹性搜索节点的水平扩展和缩减过程。
最初,我在 Kubernetes 集群上部署了一个弹性搜索集群(3 个主节点、3 个数据节点和 3 个摄取节点)。在哪里,cluster.initial_master_nodes
是:
cluster.initial_master_nodes:
- master-a
- master-b
- master-c
然后,我进行了缩减操作,将主节点 3 的数量减少到 1 个(出乎意料,但出于测试目的)。在执行此操作时,我删除了master-c
,master-b
节点并master-a
使用以下设置重新启动了节点:
cluster.initial_master_nodes:
- master-a
由于elasticsearch节点(即pods)使用持久化卷,重启节点后,会master-a
减慢以下日志:
"message": "master not discovered or elected yet, an election requires at least 2 nodes with ids from [TxdOAdryQ8GAeirXQHQL-g, VmtilfRIT6KDVv1R6MHGlw, KAJclUD2SM6rt9PxCGACSA], have discovered [] which is not a quorum; discovery will continue using [] from hosts providers and [{master-a}{VmtilfRIT6KDVv1R6MHGlw}{g29haPBLRha89dZJmclkrg}{10.244.0.95}{10.244.0.95:9300}{ml.machine_memory=12447109120, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 5, last-accepted version 40 in term 5" }
似乎它正在尝试查找master-b
and master-c
。
问题:
- 如何覆盖集群设置以便
master-a
不会搜索这些已删除的节点?