I have 2 windows10 system, how can we connect both systems with docker swarm, one system is manager node & 2nd system is worker node, please support & suggest me how can we do??? I have tried but facing that error... 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.
1 Answers
Creating a multi-node Swarm with a Windows 10 manager node is not yet supported by Docker for Windows. https://docs.docker.com/engine/swarm/swarm-tutorial/. "Currently, you cannot use Docker Desktop for Mac or Docker Desktop for Windows alone to test a multi-node swarm".
Fortunately if you need to run Windows containers, it is possible to create a mixed-OS Swarm with a Linux manager node + Windows worker nodes. It took me a lot of searching on SO + other blogs to get all the steps right. Posting everything in 1 place for convenience. Here are the steps I use for a basic Ubuntu manager + Win 10 worker Swarm:
Set up Linux machine. I tested with 64 bit Ubuntu 18.04.3 Desktop.
Install Docker engine.
sudo apt install curl sudo curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
Configure Docker to automatically start on boot in case of machine restart.
sudo systemctl enable docker.service sudo systemctl enable containerd.service
Configure firewall. Note the following ufw firewall steps are valid for Ubuntu. See alternate steps at this link for other Linux distributions like Fedora, CentOS, etc. https://www.digitalocean.com/community/tutorials/how-to-configure-the-linux-firewall-for-docker-swarm-on-ubuntu-16-04)
sudo ufw enable sudo ufw allow 22/tcp sudo ufw allow 2376/tcp sudo ufw allow 2377/tcp sudo ufw allow 7946/tcp sudo ufw allow 7946/udp sudo ufw allow 4789/udp sudo ufw reload
Show machine IP info
nmcli dev status
Locate first device name from step 5, example: "ens160".
nmcli dev show ens160
Initialize Swarm. Use the IP address from step 6: IP4.ADDRESS[1], example: "10.10.9.233/24".
sudo docker swarm init --advertise-addr=10.10.9.233 --listen-addr=10.10.9.233:2377
(if successful, terminal will return a Docker join command with token. Execute this command on worker nodes after configuring them.)
Windows Swarm worker config (Run in elevated Command Prompt. If you plan to run Windows containers, make sure Docker Desktop is set to Windows container mode before joining Swarm.)
netsh advfirewall firewall add rule name = "Cluster Management" dir=in action=allow protocol=TCP localport=2377 netsh advfirewall firewall add rule name = "Communication among nodes" dir=in action=allow protocol=TCP localport=7946 netsh advfirewall firewall add rule name = "Communication among nodes" dir=in action=allow protocol=UDP localport=7946 netsh advfirewall firewall add rule name = "Overlay traffic" dir=in action=allow protocol=UDP localport=4789 docker swarm join --token SWMTKN-1-19ouqnwbmagl4bvekw7b8qf30asjgzde3b0f7uuggiuwucmf6m-axu8c9hzz10wmhgwubde0d7bj 10.10.9.233:2377
(Optional) In case you need more Linux container capacity... Linux Swarm worker config (Use above DigitalOcean link for non-Ubuntu Linux distributions.)
sudo ufw enable sudo ufw allow 22/tcp sudo ufw allow 2376/tcp sudo ufw allow 7946/tcp sudo ufw allow 7946/udp sudo ufw allow 4789/udp sudo ufw reload docker swarm join --token SWMTKN-1-19ouqnwbmagl4bvekw7b8qf30asjgzde3b0f7uuggiuwucmf6m-axu8c9hzz10wmhgwubde0d7bj 10.10.9.233:2377

- 356
- 3
- 11