August 2017
Intermediate to advanced
332 pages
9h 16m
English
When we need to stop a worker node for maintenance, or we would just like to remove it from the cluster, we can use the Swarm draining node feature. Draining the node means asking the manager to move all tasks out of a given node and exclude it from receiving new tasks. As a result, all replicas are running only on the active nodes and the drained nodes are idle.
Let's look how this works in practice. Suppose we have three cluster nodes and a Tomcat service with five replicas:
$ docker node lsID HOSTNAME STATUS AVAILABILITY MANAGER STATUS4mrrmibdrpa3yethhmy13mwzq ubuntu-worker2 Ready Active kzgm7erw73tu2rjjninxdb4wp * ubuntu-manager Ready Active Leaderyllusy42jp08w8fmze43rmqqs ubuntu-worker1 Ready Active $ docker service create ...
Read now
Unlock full access