We have a production environment with around 15 servers that hosts about 30 IIS based REST services. We are looking at using Consul as a DNS server to lookup the services. It is not very clear from the deployment reference: https://learn.hashicorp.com/consul/datacenter-deploy/day1-deploy-intro or other documentation what is the best approach to consume the DNS servers.
It is clear we must host 3 - 5 Consul server instances for resiliency. There can be any number of clients as we need, up to into the thousands. What is not clear is how the application must interact with the DNS server(s).
Would the recommended deployment be
- Have a Consul client on each of the 15 application servers, each client binding to the default loopback address “127.0.0.1”, add 127.0.0.1 as the DNS server on each application server to talk to its local Consul client.
- Have a set of Consul agents as clients, say 5, which can be on some of the 15 servers, have these clients bind to their machine IP address using client_addr. The application will use any of the 3 Consul servers and 5 clients as DNS server to lookup the name mapping.
I suppose both get the job done, the first will probably be faster but will be more instances to maintain. The second will be fewer nodes keep available, but potentially slower and is over the network.