Can ' t join node as a worker🔗

Hello!

I’m working on a Docker Swarm project for the first time. My goal is to create a website.

I initialized Docker Swarm with docker swarm init, but I’m unable to create two additional workers.

After running the command, I receive the following response:

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

I don’t understand what the problem is.

Thank you in advance for your response.

Also, before that, I successfully initialized Docker and used the docker swarm join-token worker command. The command :

docker swarm join --token <tokenid> 172.X.X.X:2377

Hello, I would need a detailed description on how to create a node manager and join a node in order to understand my error. Thank you in advance.

As the official documentation is quite clear, i am not sure what more detailed description you expect to get than what the docs already cover:

The node that initialized a swarm becomes a manager node. Other docker hosts can be joined as either manager or worker nodes.

You might want to check on each additional docker host you want to join the swarm, whether the Swarm mode is already enabled:

docker info | grep Swarm

if the output is “Swarm: active”, the node indeed joined a swarm, and needs to leave it before it can join a new swarm cluster. On a fresh installed host, or a host that never initiated or joined a swarm, it should be inactive.

1 Like