Search code examples
dockerdocker-swarm

Docker Swarm Raft consensus


I have a reasonable server that I use to host 3 vms all running docker (docker1->3).

I have a small media pc that runs docker4.

All are configured for docker swarm.

Naively I set up all as swarm managers, but I've realized that if I reboot my main server docker4 just gives up because of (N/2)+1.

I'm now planning on demoting 2 of the vm's swarms to just workers, and adding in a cheap raspberry pi to act as a manager.

This should leave me with 3 managers. Will this allow me to restart my server without issue?


Solution

  • After adding raspberrypi and demoting 2 vms, you will have 3 managers, 2 workers with 1 manager in your server.

    Based on this link(https://docs.docker.com/engine/swarm/admin_guide/#add-manager-nodes-for-fault-tolerance) you are ok with losing 1 manager when rebooting your server. I am assuming that you have more worker nodes. Otherwise, both your workers will go down when you reboot server.