0

I am trying to use wsl2 to do hands on on docker swarm mode. However, when I use docker swarm init it initialize the current node as manager and provides token to join worker. However, when i am trying to use the command to join worker it is throwing error as

Error response from daemon: This node is already part of a swarm. Use "docker swarm leave" to leave this swarm and join another one.

Can you please help me to configure wsl2 to use docker swarm mode?

Swastik
  • 499
  • 1
  • 4
  • 10

1 Answers1

0

Where are you using the join command to join the cluster? Are you using it on another WSL instance? You obviously cannot join the master from the master machine.

  1. Check which nodes already joined, if any: docker node ls

  2. If the error is thrown on the worker (not the master) try to leave docker swarm leave and then join again.

  3. Make sure you have the right <manager-node-ip>:<port> configuration

  • these are steps i followed ```docker swarm init``` in one of the wsl instance open another terminal and jused command to join worker. I got the error. i even tried two different distro one ubuntu and kali linux. even for that i received error. – Swastik Aug 20 '23 at 14:11