This repository was archived by the owner on Jun 20, 2024. It is now read-only.
Using containers that mount /var/run/docker.sock causes No Route To Host in others #1846
Labels
Milestone
Background
This is similar to #1184 (and #1455 according to @squaremo ) . The troubleshooting history for this is here: https://groups.google.com/a/weave.works/forum/#!topic/weave-users/jYXOGyf3SOA.
Summary
When leveraging a container that mounts in /var/run/docker.sock ( Ex. Cadvisor, Logspout...), ARPs will not be recieved by containers in the Weave network, resulting in stale Mac addresses and ultimately ConnectionRefused exceptions. According to the below google groups convo, this may have been fixed in later kernel versions, but after upgrading the problem still occurs.
Detail and Reproduction
I have a multi-host cluster with ServiceA, ServiceB, and Logspout all configured and launched by docker-compose. Services A/B are based on tag 5.1 of this image. Logspout is
progrium/logspout
and the configuration in compose is:All of these containers are on the same host in the cluster. Each weave node was started with
weave launch --ipalloc-range=15.0.0.0/16 <other hosts>
. All services are launched withdocker-compose
having theDOCKER_HOST
env var set to:DOCKER_HOST=unix:///var/run/weave/weave.sock
.After launching:
1 - Run
docker exec ServiceB ip addr
and get the following forethwe
2 - Run
docker exec ServiceB ip neigh show
and get the following for ServiceB:All is right with the world.
3 - After some time (sometimes also seen after restarting / recreating), the cache of serviceB becomes out of sync with ServiceA and the two will be different. (I assume this can be correlated to something happening in
docker logs weave
.4 - At this point, one can enter ServiceA's container:
docker exec -it ServiceA bash
andcurl ServiceB:port
and will get an error about NoRouteToHost or ConnectionRefused.5 - Temporarily relieving the issue is done by restarting or recreating the ServiceB container. Repeat step 4 and it will work properly.
If there is a better way to more reliably have the system issue ARPs that have the possibility of missing, I'm all ears. But this is the way I've had to discover it.
Environment
Containers ~ 25
Conclusion
It's obvious, but the behavior I would like is that I could leverage some of these tools / containers that need to leverage the docker socket as well. Logspout, Cadvisor, and others are common and prevalent tools in the docker ecosystem as is Ubuntu 15.x Linux Distro.
From my conversations on Google Groups, I guess that this has to do with the container having the mounted /var/run/docker.sock ACKing the messages before the weaveproxy can handle broadcasting any updated MACs.
Please let me know if any more info is needed or if there is an obvious workaround or fix for this situation.
Thanks!
The text was updated successfully, but these errors were encountered: