0

I have docker swarm mode set up with 3 ubuntu 16.04 machines with vagrant. I don't think mesh routing is working at all.

If I set up a service like

docker service create --name helloworld --replicas 1 -p 8888:80 nginx

I can see my service with

docker service ls
ID            NAME        REPLICAS  IMAGE  COMMAND
evbp2spkjn50  helloworld  1/1       nginx 

I can curl to the ip of the machine that the actual container is running on:

curl 172.28.100.101:8888
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
....

But if I go to any other machine in the swarm, I am not routed properly:

curl 172.28.100.102:8888
curl: (7) Failed to connect to 172.28.100.102 port 8888: Connection refused

Now, if I scale the service such that a container is running on all of the machines like this:

docker service scale helloworld=3
helloworld scaled to 3

All of a sudden I can curl to it.

curl 172.28.100.102:8888
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
....

All ports are open between these machines (they are set up with vm.network :private_network, :ip => "172.28.100.10X", :netmask => "255.255.0.0" in vagrant).

I have tried this with a dedicated network with no change.

docker --version
Docker version 1.12.1, build 23cf638
Tim
  • 1,013
  • 1
  • 10
  • 16

2 Answers2

1

There's an open issue on github that's likely related to what you're seeing. I think there are still some edge cases where the mesh routing isn't working right, and have seen this in some of my own tests with 1.12.

BMitch
  • 231,797
  • 42
  • 475
  • 450
0

I switched from Ubuntu to RancherOS and the bad behavior disappeared. I'm guessing there is something about the kernel config that isn't right.

Tim
  • 1,013
  • 1
  • 10
  • 16