Reputation: 779
There are 4 node in my swarm, two of them are in Hongkong, the others are in USA. I create 4 service in the swarm:
Service Location
foo USA
bar HK
haha USA
hehe HK
These services use a same overlay network.
When I try ping foo
or ping haha
in HK's services, the host can't be resolved. But when I ping bar
or ping hehe
in HK's services, it works.
Any help will be appreciated, thank you!
I'm sure that all the required ports are open and accessable.
I use these commands to create services:
docker network create -d overlay --attachable test_net
docker service create --name foo --network test_net nginx:alpine
Upvotes: 2
Views: 2238
Reputation: 264831
You need to make sure the following ports are open between your docker hosts:
TCP port 2377 for cluster management communications
TCP and UDP port 7946 for communication among nodes
UDP port 4789 for overlay network traffic
See the following for more details: https://docs.docker.com/network/overlay/#operations-for-all-overlay-networks
Upvotes: 1