javaelasticsearchload-balancinghigh-availabilityelasticsearch-high-level-restclient

Elasticsearch cluster load balancing best practices


I would like to understand whether I need or is it considered as a good practice to have load balancer as part of the deployment of Elasticsearch.

As far as I understand high level rest client as well as transport client of Elasticsearch can manage load balancing between the nodes. So the client needs coma separated endpoint list and that's it.

Is there any point to have also Load Balancer at the middle? For which case it might be useful? Pros and cons of each method?


Solution

  • Normally external load-balancer in ES cluster is not very common and not required as Elasticsearch already does load balancing and by default all the data nodes in ES cluster act as co-ordinating role but if you want to improve the performance you can have dedicated co-ordinating node as well.

    If your goal is to have a smart load-balancing which improves the performance than if you are on ES 6.X or higher(turned by default on 7.X), you get it out of the box without doing any external configuration, by using Adaptive replica selection.

    Having another loadbalancer means extra configuration and another layer before your request reaches to ES, so IMHO it doesn't make any sense to use it.