4 ms·
Not really - resolve all backend servers to IPs and list all of them as the nginx backends. When a backend server is removed, update nginx backends. Round-robi
by notyourday 7y ago
Not really - resolve all backend servers to IPs and list all of them as the nginx backends. When a backend server is removed, update nginx backends.
Round-robin balancing using DNS towards a small cluster is silly - you know when any new instance is added to the pool or removed from a pool, so why not push that load balancing onto the load balancer which in your case is nginx?
- hinkley 7y agoYou're talking about layering the thing on top of Consul that I already identified in my top level comment. Consul itself advertises DNS resolution for service discovery.
- notyourday 7y agoMaybe I was not clear. Whatever is the technology that you use to register the active backends in the DNS, rather than doing name => ip address lookup per request, you can resolve all those names => ip address maps upon the service being brought up/taken down and push the resolved map as a set of backends into nginx config, thus removing the need to query DNS per request.