Home > Back-end >  How to determine number of master nodes
How to determine number of master nodes

Time:07-18

Is there a way to find out how many master nodes I need for a number of data nodes For example If I have 100 data nodes, how many masters nodes do I need? In the case of 12 data nodes Or 18 data nodes

CodePudding user response:

You don't need many master nodes in Elasticsearch as its useful only for managing the admin tasks and doesn't do any intensive operations like indexing or searching, but you need to have atleast minimum 3 master nodes to avoid the split brain issues and should always have odd number of master nodes in the cluster for quorum to work properly.

If you going to have 100 data nodes, instead of increasing the number of master nodes, you can scale-up your master nodes ie increase their infra, so that they can handle more admin tasks, you can know whether you need to increase it or not, by checking how much time updating the cluster state time takes and if this operation is getting time out, you should first try to upscale the master nodes and if thats not sufficient you can add more master nodes to your cluster.

CodePudding user response:

if you are running 8.X (or above) then please read https://www.elastic.co/guide/en/elasticsearch/reference/current/high-availability-cluster-small-clusters.html#high-availability-cluster-design-three-plus-nodes;

However, it is good practice to limit the number of master-eligible nodes in the cluster to three. Master nodes do not scale like other node types since the cluster always elects just one of them as the master of the cluster. If there are too many master-eligible nodes then master elections may take a longer time to complete. In larger clusters, we recommend you configure some of your nodes as dedicated master-eligible nodes and avoid sending any client requests to these dedicated nodes. Your cluster may become unstable if the master-eligible nodes are overwhelmed with unnecessary extra work that could be handled by one of the other nodes.

so you really don't need more than 3. this discuss topic has some extra information

  • Related