Search code examples
dockernfsheartbeatpacemakerdrbd

docker - in production - HA


how to run docker in production, with a active/active or active/standby HA system? are there any guides or best practices?

i am thinking of 3 scenarios:

1) NFS - for two servers - wich are prepped with docker-machine and mounting a shared NFS to /var/lib/docker/ - so both docker nodes should see the same files. (using some sort of filer, like vnx, efs, and so on.)

2) using DRBD to replicate a disk - and mount it to: /var/lib/docker/ - so data is on both nodes, and the active node can mount it and run containers, in case of failover the other node mounts and starts the containers

3) using DRBD - as above - and export a NFS server, mounting the NFS on both nodes to : /var/lib/docker/ - so as above both nodes can mount and run containers, using Heartbeat/Pacemaker to travel the virtual-IP & DRBD switching

what is the best practice on running docker-containers in production to make them high availaible.

regards


Solution

  • Persistent storage is still somewhat the elephant in the room in the container/docker world.

    I wouldn't recommend using any of the approaches that you're suggesting. The only exception would be if you put some particular data onto a shared volume (using a volume mount) (but not the entire /var/lib/docker).

    There are lots of things going on in the container space and there's a volume plugins that integrates directly into Docker. One of the volume plugins/solutions that is gaining the most momentum is Flocker, which is worth looking into.

    Once you've moved your data out of your containers, setting up a HA system becomes a lot easier, as the containers become more or less ephemeral.

    You can then use something like Kubernetes, Docker Swarm, or Docker Datacenter to manage/monitor these containers.