首页 > 解决方案 > 当 node.master=true 和 node.data=false 的节点没有被选为主节点时,它将承担什么任务?

问题描述

假设我的弹性搜索集群中有六个节点。

node1 : node.master = true, node.data = false
node2 : node.master = true, node.data = false
node3 : node.master = true, node.data = false
node4 : node.master = false, node.data = true
node5 : node.master = false, node.data = true
node6 : node.master = false, node.data = false

如果node1被选为主节点,我想知道node2和node3会承担什么任务?他们会闲着吗?

标签: elasticsearch

解决方案


Yes, they will remain mostly idle waiting their turn to be elected. They will observe all the changes to the cluster state so that when their turn comes to be elected master, they are ready to manage the cluster right away and this will happen transparently without you having to take any actions.

您可能认为这完全是对资源的浪费,但是您需要考虑到这一点,并考虑如果您只有一个主节点并且由于某种原因它失败了会发生什么情况,您的集群将变为红色并且不再起作用,直到您让主人重新启动并运行。

在这种情况下,您的企业会受到多大的影响和痛苦?如果您的集群不是业务关键的并且您可以接受一些停机时间,那么您绝对不需要两个让这两个符合条件的主节点启动并运行,但是由于主节点既不需要内存也不需要大的磁盘空间,额外的成本应该可以忽略不计。


推荐阅读