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 in Docker by Jenny
23 views

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

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 by Sirajul
• 25,180 points

Related Questions In Docker

+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,110 points

edited Oct 16, 2018 by lina 4,203 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
• 9,530 points
323 views
0 votes
1 answer
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
997 views
0 votes
2 answers