May 2017
Intermediate to advanced
436 pages
9h 44m
English
Fortunately, failover strategies are part of Docker Swarm. Remember, when we execute a service command, we are not telling Swarm what to do but the state we desire. In turn, Swarm will do its best to maintain the specified state no matter what happens.
To test a failure scenario, we'll destroy one of the nodes:
docker-machine rm -f node-3
Swarm needs a bit of time until it detects that the node is down. Once it does, it will reschedule containers. We can monitor the situation through service ps command:
docker service ps go-demo
The output (after rescheduling) is as follows (ID is removed for brevity):

As you can see, after a ...
Read now
Unlock full access