2

We are using docker since 1 1/2 Year with "single Host" Setups without trouble. But now we want to go further and use the Docker Swarm (latest version).

Our old setup was just, single hosts with nginx as Reverse-Proxys and some magic to update the configs and request SSL certificates for new services.

What i do not understand: How to setup Failover/HA with Docker Swarm

For example:

  • 3 VMs all acting as Master + Worker (i know not the perfect setup, but we have to save money).

Now let's say GoDaddy with a Domain like myswarm.com, this domain has to be set to one external IP, i would choose on of the Swarms VM's external IPs and it should work.

But what happens when the VM linked to the Domain goes down? How to handle this scenario with Docker? Or does i need 2 more VMs with HAProxy and some VIPs facing outside?

opHASnoNAME
  • 645
  • 2
  • 7
  • 18
  • I think you need something like an elastic ip. If one node fails, the other nodes need to act on the failed ip aswell. – Tobias Apr 15 '18 at 21:48

1 Answers1

3

The IP address must be assigned to a network interface available to the host operating system. All nodes in the swarm must be able to access the manager at the IP address.

Because other nodes contact the manager node on its IP address, you should use a fixed IP address.

You can run ifconfig on Linux or macOS to see a list of the available network interfaces.

If you are using Docker Machine, you can get the manager IP with either docker-machine ls or docker-machine ip <MACHINE-NAME> — for example, docker-machine ip manager1.

Source: https://docs.docker.com/engine/swarm/swarm-tutorial/#the-ip-address-of-the-manager-machine

Also, the guidance should be helpful to deploy HA in Docker Swarm http://docs.master.dockerproject.org/swarm/multi-manager-setup/

Mr. Raspberry
  • 3,918
  • 13
  • 32