Hi
I´m running a cluster of 4 nodes (one is the master as well) using Ubuntu 14.4 LTS (Vagrant) and docker 1.12.1 in swarm mode.
I create a service like this
docker service create --name tomcat --replicas 1 --publish 8888:8080 localhost:5000/tomcat
assuming, port 8888 will be mapped to every node, but is mapped only to two of them.
vagrant@swarm-master:~$ curl 10.50.30.100:8888 > /dev/null
OK
vagrant@swarm-master:~$ curl 10.50.30.101:8888 > /dev/null
Failed to connect to 10.50.30.101 port 8888: Connection refused
vagrant@swarm-master:~$ curl 10.50.30.102:8888 > /dev/null
Failed to connect to 10.50.30.102 port 8888: Connection refused
vagrant@swarm-master:~$ curl 10.50.30.103:8888 > /dev/null
OK
Every time I reboot the cluster I get a new set of hosts which are able to access the service.
I have some other services with an equivalent setup. All of them are jumping around the hosts.
So is a pure sshd service (created for debugging) accessible from host 102 and 100, and so on.
What am I doing wrong?
Many thanks,
Uli
Here some more info:
docker service inspect --pretty tomcat
ID: camkygzku4sjhivo8hx3l5tzz
Name: tomcat
Mode: Replicated
Replicas: 1
Placement:
UpdateConfig:
Parallelism: 1
On failure: pause
ContainerSpec:
Image: localhost:5000/tomcat
Resources:
Ports:
Protocol = tcp
TargetPort = 8080
PublishedPort = 8888
docker node inspect --pretty swarm-master
ID: 9uyu5osu5rbynyvfzwt1zvhnm
Hostname: swarm-master
Joined at: 2016-09-04 12:11:29.246405622 +0000 utc
Status:
State: Ready
Availability: Active
Manager Status:
Address: 10.50.30.100:2377
Raft Status: Reachable
Leader: Yes
Platform:
Operating System: linux
Architecture: x86_64
Resources:
CPUs: 1
Memory: 490 MiB
Plugins:
Network: bridge, host, null, overlay
Volume: local
Engine Version: 1.12.1
docker node inspect --pretty swarm-node1
ID: 7sotq9ehw6g808gc5q8pp4wbr
Hostname: swarm-node1
Joined at: 2016-09-04 12:13:03.934751409 +0000 utc
Status:
State: Ready
Availability: Active
Platform:
Operating System: linux
Architecture: x86_64
Resources:
CPUs: 1
Memory: 490 MiB
Plugins:
Network: bridge, host, null, overlay
Volume: local
Engine Version: 1.12.1