I am trying to connect multiple nodes in elastic search with 5 nodes. 2 nodes as master nodes and 3 as data nodes.
any effect if I use the replication as 2? performance will be good or not?
I am trying to connect multiple nodes in elastic search with 5 nodes. 2 nodes as master nodes and 3 as data nodes.
any effect if I use the replication as 2? performance will be good or not?
First of all avoid keeping 2 master nodes, as it would be vulnerable to split brain problem.
How many will be efficient ?
Number of master/data nodes highly depends on your use case with the cluster. Try getting answers to questions like:
how to coordinate them
You don't need to. Elasticsearch's nodes are capable of doing so. Just ensure your elasticsearch.yml has all the node IPs mentioned (Under unicast hosts, I would prefer to avoid multicast). Use a configuration like this:
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["<node1-ip:port>", "<node2-ip:port>", "<node3-ip:port>", "<node4-ip:port>"]
any effect if I use the replication as 2
Adding replicas would increase disk usage and heap size too. For 4 nodes, replication factor of 1 should be enough, unless you need high redundancy.
Because you've added spring-data-elasticsearch as a tag, I am assuming you want to use it as a Transport client with Elasticsearch. Check out this tutorial to get started.