Hello all,
I am following the getting started tutorial and am on part 4 where I create a load balanced python web app and distribute it across nodes using docker swarm.
Instead of using docker-machine and virtualbox, I am using a cluster of raspberry pis with docker installed.
For sake of this diagnosis, I am going to use only two replicas and two nodes in the swarm: chicago (manager) and denver.
I am able to add them to the docker swarm and distribute the app across them. I know that port 7946 is open and I have added firewall rules to allow access for both 7946 tcp/udp and port 4879 udp. I am able to curl this port on the external interfaces (I know this is not orthodox but it is the only immediate way I know to make sure the port is open) and I will get garbled output, as I would expect.
The problem is, when I try to curl the web app (which is running on port 4000) I get a response the first time:
curl chicago:4000
Hello World!
Hostname: 4e6a6687c92eVisits: cannot connect to Redis, counter disabled
but the second time it hangs forever.
I see the same thing from the second node:
curl denver:4000
Hello World!
Hostname: 8e04674d0757Visits: cannot connect to Redis, counter disabled
second request also hangs.
It appears that it is trying to load balance (as you can see the container id of the container being directly pinged in the first request) but for some reason the second request it is not able to access the other node, so it times out.
I have tried doing a tcpdump on port 4000 on denver, then run the curl against chicago twice, and I don’t see anything on either eth0 or docker0.
I am at a loss for how to further diagnose this. Can someone point me in the right direction?
Thanks
EDIT: In case it is relevant, here is the output of network inspect (192.168.4.100 is chicago and 192.168.4.101 is denver):
docker network inspect getstartedlab_webnet
[
{
"Name": "getstartedlab_webnet",
"Id": "tfmnjicyoygd8unyubccqqlje",
"Created": "2019-06-21T11:43:38.552690472+01:00",
"Scope": "swarm",
"Driver": "overlay",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "10.0.1.0/24",
"Gateway": "10.0.1.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"59b66568e536b86c145dce9b6c21233de3c7865d91b0b274a8cc5fc02548bddb": {
"Name": "getstartedlab_web.2.cs04pkh1j1zrdfs89he5dptjx",
"EndpointID": "5ba6add127a86feff4ee5dc2fd90e04ca68350684d225b28902186ffefecb87f",
"MacAddress": "02:42:0a:00:01:03",
"IPv4Address": "10.0.1.3/24",
"IPv6Address": ""
},
"lb-getstartedlab_webnet": {
"Name": "getstartedlab_webnet-endpoint",
"EndpointID": "75de1dfb3a80eab7696a13faa66074e92542b1f5ad5b302227addb6e8d60fba5",
"MacAddress": "02:42:0a:00:01:05",
"IPv4Address": "10.0.1.5/24",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.driver.overlay.vxlanid_list": "4098"
},
"Labels": {
"com.docker.stack.namespace": "getstartedlab"
},
"Peers": [
{
"Name": "43b9b37a724a",
"IP": "192.168.4.100"
},
{
"Name": "6c38ca20f355",
"IP": "192.168.4.101"
}
]
}
]