No healthy node available in the cluster


I tried to create a simple Swarm cluster without using Docker Machine. So I launched docker daemon with:

docker daemon -H tcp:// -H unix:///var/run/docker.sock

I got the Swarm token

docker run --rm swarm create

and let Docker engine join to itself.

docker run -d swarm join --addr=x.x.x.108:2375 token://c9901d16a699397afa1f64122d9fba33

Swarn list looks fine:

docker run --rm swarm list token://c9901d16a699397afa1f64122d9fba33

Then I created manager on the same host and using 8888 port:

docker run -d -p 8888:2375 swarm manage token://c9901d16a699397afa1f64122d9fba33

I ran “hello world” container to test my Swarm cluster, but it showed an error:

docker -H tcp:// run hello-world
Error response from daemon: No healthy node available in the cluster

I used the docker info to check,and I got noting in my Swarm cluster:

docker -H tcp:// info
Containers: 0
Images: 0
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 0
CPUs: 0
Total Memory: 0 B
Name: 6300a3102044

I created a Swarm cluster with Docker Machine before, and it works fine.
Do I miss anything ?

Finally, I figure out what’s wrong in my lab.

Docker daemon should run with -H on each node of cluster.

docker daemon -H tcp:// -H unix:///var/run/docker.sock

And make sure the firewall or iptables on each node allows 2375 port for Swarm manager accessing.

Then rebuild the Swarm cluster, it should be work now.

why we should have -H and use tcp 237?