O'Reilly logo

The DevOps 2.2 Toolkit by Viktor Farcic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exploring fault tolerance

Since we are exploring self-healing (not self-adaptation), there's no need to deploy all the stacks we used thus far. A single service will be enough to explore what happens when a node goes down. Our cluster, formed out of t2.micro instances, would not support much more anyways.

docker service create --name test \  
    --replicas 10 alpine sleep 1000000 

We created a service with ten replicas. Let's confirm that they are spread across the three nodes of the cluster:

docker service ps test

The output is as follows (IDs are removed for brevity):

Let's exit the cluster before we move onto a discussion how to simulate a failure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required