Load balancing microservices using Zookeeper

In the previous recipe, we orchestrated a Zookeeper instance along with an Exhibitor instance. In this recipe, we will utilize these instances to load-balance the geolocation microservice. We will be spinning off two instances of the geolocation microservice and see how we can use Zookeeper and the Curator API to perform round-robin style load balancing on the HTTP endpoints exposed by the geolocation microservice.

Load-balancing HTTP-based microservices is a significant step towards onboarding your microservice to a cluster such as Mesos or Kubernetes. Scalability will not have any value unless you figure out a way to load-balance your microservices. Zookeeper is just one way to do this; with the tools ...

Get Microservices Deployment Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.