replicate docker swarm cluster

0 votes

I have the Docker Swarm cluster setup in my servers. I have 3 manager nodes and 9 working nodes. 

I would like to replicate the same in the in my production server but using scripts instead of commands.

Any help would be appreciated.

Aug 23, 2018 in Docker by Nilesh
• 7,060 points
909 views

1 answer to this question.

0 votes

There is nothing like in-built utilities for that you can use the command like this :

You can create your custom script like this :

for i in `cat app_server.txt` ; do echo $i ; ssh -i /path/to/your_key.pem  $i "sudo docker swarm join --token your-token-here ip-address-of-manager:port" ; done

Here app_server.txt is the ip address of your worker node that you want to add in your swarm.

--token : your token generated by manager on docker swarm init

answered Aug 23, 2018 by Kalgi
• 52,350 points

Related Questions In Docker

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
• 7,060 points
1,025 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,630 views
+1 vote
1 answer
+2 votes
1 answer
0 votes
1 answer

Docker Swarm Cluster: daemonize

Make sure you run the deamon as ...READ MORE

answered Aug 27, 2018 in Docker by Kalgi
• 52,350 points
703 views
+2 votes
1 answer

Nodes not able to join docker swarm cluster

You need to provide more information like ...READ MORE

answered Sep 26, 2018 in Docker by Kalgi
• 52,350 points
1,887 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