Adding replication/slave nodes to node running elastic search in production

Hello Everyone,

I am little new into elastic search world.

I have deployed elastic search single node that includes multiple index in production on one of the systems that contains more than 1L docs.

My Questions are -

  1. I have different machines with elastic search installed on them so now how do i add multiple nodes(maybe called slaves) to replicate this data and indexes on all of them that will help in case of failure of current master node and also help in load balancing (but also needs to avoid split brain)

  2. Also If someone can explain when a search query is executed will it fetch result from master or it will do load balancing and fetch result from any nodes in cluster.

Thank You in advance
-Sam

Hello Sam,

I have different machines with Elasticsearch installed on them so now how do i add multiple nodes(maybe called slaves) to replicate this data and indexes on all of them that will help in case of failure of current master node and also help in load balancing (but also needs to avoid split brain)

In a nutshell, to join nodes together and form a cluster, you'll want to have cluster.name set the same + populate discovery.zen.ping.unicast.hosts with host names or IP addresses of other nodes. (note: it's not necessary to populate this property with every node in the cluster, it really just needs a few common "seed" nodes for initial discovery).

To avoid split brain, you'll want to configure discovery.zen.minimum_master_nodes using the formula described in the docs.

The Add Failover section of the Definitive Guide has a good explainer on how HA works.

Also If someone can explain when a search query is executed will it fetch result from master or it will do load balancing and fetch result from any nodes in cluster.

That ultimately depends if the elected master is also a data node and hosting shards. Search operations are load balanced between primary and replica shards. I'd recommend checking out Distributed Search Execution as it does a great job of explaining the scatter/gather nature of search.

Hope this helps!

1 Like

Thank you for your quick response Robbie. I will try to set that up and will get back to you if I ran in an issue

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.