I am trying to configure a docker cluster with swarm and consul . I have manager , host1 and host2 .
I run the consul and swarm manager containers in the manager.
$ docker run --rm -p 8500:8500 progrium/consul -server -bootstrap $ docker run -d -p 2377:2375 swarm manage consul://<manager>:8500
On host1 and host2, I change the daemon settings using --cluster-store and --cluster-advertise and restart docker daemon .
host1 DOCKER_OPTS="--cluster-store=consul://<manager>:8500 --cluster-advertise=<host1>:2375" host2 DOCKER_OPTS="--cluster-store=consul://<manager>:8500 --cluster-advertise=<host2>:2375"
When I join host1 and host2 to the swarm, it fails.
host1 $ docker run --rm swarm join --advertise=<host1>:2375 consul://<manager>:8500 host2 $ docker run --rm swarm join --advertise=<host2>:2375 consul://<manager>:8500
From the log of the swarm manager, it throws an error.
time="2016-01-20T02:17:17Z" level=error msg="Get http://<host1>:2375/v1.15/info: dial tcp <host1>:2375: getsockopt: connection refused" time="2016-01-20T02:17:20Z" level=error msg="Get http://<host2>:2375/v1.15/info: dial tcp <host2>:2375: getsockopt: connection refused"
source share