How to add one worker node to the Docker swarm

0 votes

Hi Guys,

I have initialized one Docker swarm in the Linux system. Now I want to add one worker node to the swarm. How can I do that?

Dec 24, 2020 in Docker by akhtar
• 38,260 points
1,191 views

1 answer to this question.

0 votes

Hi@akhtar,

You will get one token when you run the docker swarm init command. That token you need to run in your worker node and it will automatically add to the swarm.

$ docker swarm init --advertise-addr 172.31.11.98
Swarm initialized: current node (v99wt041ykw5v9rfkktp7fuhy) is now a manager.
To add a worker to this swarm, run the following command:
    docker swarm join --tokenxxxxxxxxxxxxxxxxxxxrnd33m7g3xfg8o0gyl1rgkxkliq8kq2ovbf2inz84bhwbdzp9ddvxrbfoi 172.31.11.98:2377

In the above example, you can see that when I ran the init command it shows me one token.

answered Dec 24, 2020 by MD
• 95,460 points

Related Questions In Docker

+1 vote
1 answer

How to add or remove label metadata in the swarm node?

Node labels provide a flexible method of ...READ MORE

answered Dec 28, 2020 in Docker by MD
• 95,460 points
3,985 views
0 votes
1 answer

How to change node availability in docker swarm?

Hi@akhtar, You can change the node availability according to ...READ MORE

answered Dec 28, 2020 in Docker by MD
• 95,460 points
3,610 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,925 views
0 votes
1 answer

How to remove a worker node from the docker swarm cluster?

Hi@akhtar, To remove a worker node from the ...READ MORE

answered Dec 24, 2020 in Docker by MD
• 95,460 points
5,601 views
0 votes
1 answer

How to get the hostname of the manager node in the Docker swarm?

Hi@akhtar, You can find the manager hostname using ...READ MORE

answered Dec 24, 2020 in Docker by MD
• 95,460 points
4,178 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