How to change a node s availability

0 votes
I have 2 manager nodes and a couple of worker nodes in a swarm.I want to take the backup of the two manager nodes and hence need to go offline.Kindly specify how do I change the availability of these nodes and how do i maintain the swarm intact?
Jul 8, 2019 in Docker by Jenny

1 answer to this question.

0 votes

Hey @jenny,  You can do the following in case you want to change the manager nodes availability

$ docker node update --availability drain node-1


When a manager node becomes unavailable or if you want to take a manager offline for maintenance, You can promote a worker node to the manager role.Similarly, you can demote a manager node to the worker role.

Regardless of your reason to promote or demote a node, you must always maintain a quorum of manager nodes in the swarm.

  • To promote a node or set of nodes, run docker node promote from a manager node:
$ docker node promote node-3 node-2

Node node-3 promoted to a manager in the swarm.
Node node-2 promoted to a manager in the swarm.
  • To demote a node or set of nodes, run docker node demote from a manager node:
$ docker node demote node-3 node-2

Manager node-3 demoted in the swarm.
Manager node-2 demoted in the swarm.
answered Jul 8, 2019 by Sirajul
• 59,230 points

Related Questions In Docker

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,440 points
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,220 points

edited Oct 16, 2018 by lina 33,508 views
0 votes
1 answer
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 10,610 points
+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
0 votes
2 answers
+1 vote
2 answers
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP