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,220 points
4,359 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
• 7,060 points

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer

Docker image of maven returns this error - could not create local repository

Instead of mounting the root/.m2 folder to ...READ MORE

answered Aug 10, 2018 in Docker by Sophie may
• 10,620 points
5,637 views
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
• 7,060 points
1,030 views
+2 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
3,983 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
• 7,060 points
12,405 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
• 7,060 points
3,532 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP