docker swarm throwing an error “swarm already part of swarm”

0 votes

I'm trying to run docker swarm on my local machine and trying to init the swarm. Its working perfectly fine. But when i try to add a new node or a worker to the existing manager or node it throws the following error

$docker swarm join --token SWMTKN-1-5tyw8ux789wpa7yyt75qbilb669tiw53pxriyxu48niznpmaka-7u63l4hom3h60myvtyw8p1mcj 192.168.2.219:2377

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

How do i go about this?

Aug 22, 2018 in Docker by lina
• 8,110 points
1,076 views

1 answer to this question.

0 votes

You run the docker swarm init to create a swarm on the machine that will be a manager node. Then, on the other machines that you own you run the docker swarm join command to add them to the swarm. You cannot add to the swarm a machine that already is on the swarm. In your case, you try to add to the swarm the manager that created the swarm.

When you initiate a swarm, the machine from which you initiated the swarm is already connected to the swarm, you do not have to do anything explicitly to connect it to swarm.

After you initiate the swarm, you may (and should) add other machines as managers or workers.

answered Aug 22, 2018 by Nilesh
• 6,880 points

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Access IP address of Couchbase container on Docker Swarm cluster

The property .NetworkSettings.Ports is a map, not a struct. ...READ MORE

answered Aug 24, 2018 in Docker by Nilesh
• 6,880 points
100 views
0 votes
2 answers

How do I force Docker for a clean build of an image ?

You could try this inorder to clean ...READ MORE

answered Aug 6 in Docker by Sirajul
• 37,930 points
1,684 views
0 votes
1 answer
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
1,050 views
0 votes
1 answer

Error while trying to run an image - Docker

This error means that the container tries ...READ MORE

answered Aug 22, 2018 in Docker by Nilesh
• 6,880 points
1,820 views
0 votes
1 answer

Init could not choose ip address error while doing docker swarm init

First look for the public IP of ...READ MORE

answered Aug 23, 2018 in Docker by Nilesh
• 6,880 points
341 views