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 -
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)
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.
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).
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.