Docker Community Forums

Share and learn in the Docker community.

How to join docker swarm worker in azure

HI All,

How to communicate docker swarm communication between nodes. Please help me out on this question any links or notes will be helpful or direct answer

I have 2 Server in Cloud

  1. GCP as a Master Node
  2. Azure as a Worker Node

I want to connect worker node to master node do that i have enable ports 4789, 7946, 2377 on both gcp and azure. Here is what i did

GCP - 34.66.1xx.xx
Azure - 40.71.1xx.xx

Ping working in both gcp and azure
ping 34.66.1xx.xx - working gcp/azure
ping 40.71.1xx.xx – working gcp/azure

telnet is not working in azure
telnet 34.66.1xx.xx 2377 - working gcp/azure
telnet 34.66.1xx.xx 7946 - working gcp/azure
telnet 34.66.1xx.xx 4789 - not working gcp/azure

telnet 40.71.1xx.xx 2377 – not working gcp/azure
telnet 40.71.1xx.xx 7946 - not working gcp/azure
telnet 40.71.1xx.xx 4789 - not working gcp/azure
Error:-
Trying 40.71.1xx.xx…
telnet: Unable to connect to remote host: Connection refused

In Azure i have enable ICMP also but working
In Terminal of (Azure VM) as i try to join worker node into master node of (GCP)
sudo docker swarm join --token SWMTKN-1-0ey1668q838llgllt6xokqr6we2l8bxxxxxxxngk8t8fvtd3k4d1enxxxxxqwvzasdg0174sfvacn 34.133.8xxx.xx:2377
Error response from daemon: Timeout was reached before node joined. The attempt to join the swarm will continue in the background. Use the “docker info” command to see the current swarm status of your node.

Even i did netstat -tulpn | grep LISTEN - Azure but in GCP is showing
there it is not showing me any open ports

I dont know where im wrong and im new to this please help me out

Swarm uses the RAFT consensus algorithm under the hood. RAFT requies a low latency network to work properly. Which is typicaly no problem within availability zones within a region of a provider, will cause problem if you span regions or providers.

For the sake of reliability, you should consider a different solution…

what may be the solution please tell me that different solution

OR within that can do plse tell me now

i think regions are different in gcp and azure and what is RAFT ?

I am afraid you won’t like the answer: stay with your cluster within a provider and region?

A short lmgtfy search brought this result for the search terms “raft algorithm”: https://raft.github.io

Good luck!