4 ms·
> a given hostname lookup by a given container in a given service discovery scope will always return the same IP Did you mean this to cover the situation where
by bboreham 10y ago
> a given hostname lookup by a given container in a given service discovery scope will always return the same IP
Did you mean this to cover the situation where N containers have registered the same name? I thought Docker DNS returned all such results in random order.
Given that, if one of those containers goes offline and Java has cached its address, you have the problem the parent was alluding to.
- shykes 10y agoThat's incorrect. You are describing DNS-based load-balancing, which would indeed rely on the container's resolver implementation. But Docker doesn't do that. Instead it always resolves the service name to the same IP, which is load-balanced by IPVS. That way even the world's crappiest dns caching implementation will still be handled properly. So when I said that Docker doesn't rely on the container's DNS resolver, I really meant it. We have seen in past lives the consequences of "DNS abuse" and have been careful to avoid it.
- bboreham 10y agoI was going by https://blog.docker.com/2016/04/docker-engine-1-11-runc/ https://blog.docker.com/2016/04/docker-engine-1-11-runc/ which advertised "DNS round robin load balancing". EDIT: calmer tone
- theod 10y agoDocker 1.12 built-in load-balancing supports both VIP based LB using IPVS and also DNS-RR and it is configurable per-service. VIP based LB is the default though. All of these will be fully documented shortly.