docker swarm stop containers on quorum loss
This is a somewhat simplified scenario, but I would like to know how people deal with these kinds of problems.
I have a docker swarm consisting of 3 managers and a service that writes to a network volume. The service should therefore run only once, so there are no conflicts. I would like it to restart on a different host if it’s current host dies. The problem is that if the current host loses it’s connection to the other hosts. The service continues running on that host and is also restarted on one of the two remaining hosts because they still have the quorum. This results in 2 instances of the service which could lead to conflicts.