Elastic Load Balancer

Hi,
I am new to elastic, trying to set up my cluster.
I have 3 master nodes, 3 data nodes and 1 client node, each one of them runs on a different machine.

My question is, is there a default load balancer that gets the transport and sends it to the appropriate nodes?

If I want to send data to the cluster, to which address should I send it, as each data node has a different IP address?
Do I have to use an external LB for that?

Sorry for the basic question... any help would be appreciated!

Hi @El-k, Elasticsearch nodes will try to balance load naturally between themselves and you should not need to route requests to a specific node manually. Any node has the ability to effectively function as an internal load balancer across the cluster.

We do generally recommend that you don't route requests to a dedicated master node, as those nodes need to fulfil additional duties.

For more information, see:

Thanks, @Sander_Philipse . Just to make sure I got it right:

Assuming that Elasticsearch nodes perform an internal load balancer,
can I choose one random data-node IP address
and always access the cluster endpoint using 'http://:9200/'?

Will the cluster then direct the request to the right node?

The node that receives the request will coordinate the execution. This will often involve multiple nodes in the cluster.

All official clients, including Beats and Logstash, support specifying a number of nodes in the connection string and will send requests to all nodes listed.

What you are proposing is bad for primarily 2 reasons:

  • Coordinating a request is not free and adds load to the node. Having only a sinle node coordinating all requests can cause load imbalance and performance problems. Sometimes a number of dedicated coordinating only nodes are used as the entry point to the cluster, but that is generally not needed for small clusters.
  • If the clients are only able to connect to one node that node is a single point of failure. If you need to restart it, e.g. due to an uprade, or it crashes the clients will experience an outage.

Thanks, @Christian_Dahlqvist . This is the answer I was looking for!
At the end, decided to create an internal LB to manage traffic to data nodes with health checks.

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