Closed thacoon closed 5 years ago
I have checked the logs and found that I have a network error:
level=error msg="error reading the kernel parameter net.ipv4.vs.expire_nodest_conn" error="open /proc/sys/net/ipv4/vs/expire_nodest_conn: no such file or directory"
$ journalctl -fu docker.service
-- Logs begin at Fri 2019-07-26 15:28:10 CEST. --
Jul 26 15:37:35 traefik1 dockerd[5674]: time="2019-07-26T15:37:35.056952711+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:i9grxo7b0xxc7dqj9h6ablmx4 leaving:true netPeers:0 entries:3 Queue qLen:0 netMsg/s:0"
Jul 26 15:37:35 traefik1 dockerd[5674]: time="2019-07-26T15:37:35.059081426+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:ertvdlvgi0574haq1s1g4ro7n leaving:false netPeers:2 entries:4 Queue qLen:0 netMsg/s:0"
Jul 26 15:42:35 traefik1 dockerd[5674]: time="2019-07-26T15:42:35.256324150+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:i9grxo7b0xxc7dqj9h6ablmx4 leaving:true netPeers:0 entries:3 Queue qLen:0 netMsg/s:0"
Jul 26 15:42:35 traefik1 dockerd[5674]: time="2019-07-26T15:42:35.257912878+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:ertvdlvgi0574haq1s1g4ro7n leaving:false netPeers:2 entries:4 Queue qLen:0 netMsg/s:0"
Jul 26 15:44:27 traefik1 dockerd[5674]: time="2019-07-26T15:44:27.094119252+02:00" level=info msg="initialized VXLAN UDP port to 4789 "
Jul 26 15:44:27 traefik1 dockerd[5674]: time="2019-07-26T15:44:27.415494640+02:00" level=error msg="error reading the kernel parameter net.ipv4.vs.expire_nodest_conn" error="open /proc/sys/net/ipv4/vs/expire_nodest_conn: no such file or directory"
Jul 26 15:47:35 traefik1 dockerd[5674]: time="2019-07-26T15:47:35.456526093+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:i9grxo7b0xxc7dqj9h6ablmx4 leaving:false netPeers:1 entries:6 Queue qLen:0 netMsg/s:0"
Jul 26 15:47:35 traefik1 dockerd[5674]: time="2019-07-26T15:47:35.458949597+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:ertvdlvgi0574haq1s1g4ro7n leaving:false netPeers:2 entries:6 Queue qLen:0 netMsg/s:0"
Jul 26 15:52:35 traefik1 dockerd[5674]: time="2019-07-26T15:52:35.656514539+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:i9grxo7b0xxc7dqj9h6ablmx4 leaving:false netPeers:1 entries:6 Queue qLen:0 netMsg/s:0"
Jul 26 15:52:35 traefik1 dockerd[5674]: time="2019-07-26T15:52:35.658840449+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:ertvdlvgi0574haq1s1g4ro7n leaving:false netPeers:2 entries:6 Queue qLen:0 netMsg/s:0"
Jul 26 15:57:35 traefik1 dockerd[5674]: time="2019-07-26T15:57:35.856568291+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:i9grxo7b0xxc7dqj9h6ablmx4 leaving:false netPeers:2 entries:16 Queue qLen:0 netMsg/s:0"
Jul 26 15:57:35 traefik1 dockerd[5674]: time="2019-07-26T15:57:35.857931138+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:ertvdlvgi0574haq1s1g4ro7n leaving:false netPeers:2 entries:6 Queue qLen:0 netMsg/s:0"
Jul 26 16:02:36 traefik1 dockerd[5674]: time="2019-07-26T16:02:36.057021608+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:i9grxo7b0xxc7dqj9h6ablmx4 leaving:false netPeers:2 entries:16 Queue qLen:0 netMsg/s:0"
Jul 26 16:02:36 traefik1 dockerd[5674]: time="2019-07-26T16:02:36.058673033+02:00" level=info msg="NetworkDB stats traefik1(00c1cc886d65) - netID:ertvdlvgi0574haq1s1g4ro7n leaving:false netPeers:2 entries:6 Queue qLen:0 netMsg/s:0"
However if I run the ping command in one container of the working node I can connect to the traefik container on the manager node.
$ docker exec -it b84cbe395874 /bin/bash
$ ping entry_traefik
PING entry_traefik (10.0.0.6): 56 data bytes
64 bytes from 10.0.0.6: seq=0 ttl=64 time=1.360 ms
64 bytes from 10.0.0.6: seq=1 ttl=64 time=0.196 ms
64 bytes from 10.0.0.6: seq=2 ttl=64 time=0.183 ms
Edit:
I have fixed it. This was NOT a docker swarm issue.
I had misconfigured my docker-compose files. When using docker-swarm and traefik the traefik labels in the docker-compose file needs to be in the deploy:
section. Like:
services:
app:
image: ...
....
deploy:
labels:
- "traefik.docker.network=web"
...
I have an overlay network
web
but my containers are unable to communicate over the network. I have two servers. One server, the manager node, contains a traefik docker. The other server, a worker node, contains my application, a database and a nginx container. If I inspect the networkweb
you can see that both servers appear as peers but only the local containers are shown in containers.I am using
Docker version 18.09.8, build 0dd43dd87f
.My steps to set it up was as following:
docker network inspect web
on manager nodedocker network inspect web
on manager nodeI have allowed the ports:
ufw status && netstat -tulpn
on manager node:ufw status && netstat -tulpn
on worker node:Edit: