Docker persistent storage across hosts?

Viewed 694

I am working on a Vagrantfile to set up a cluster of 3 Ubuntu 16.04 hosts for dev with Docker. Two of the requirements are:

  • For each node make sure you attach 2 new “block devices” as this will be needed for creating pools of persistent storage across hosts
  • Setup a persistent storage solution across the docker hosts to make sure data is never lost in the event of container failures or cross-host rescheduling.

I'm not an expert on Docker persistent storage across hosts. The first requirement is easy, I use the VirtualBox provider and createHD to create two VDI's per host if they don't already exist and then storageAttach to make them visible on the host. If they are new I mkfs.ext4 (or ??? I'm open to using other filesystems), create mount points and mount. Done.

The second requirement is the one that is kicking my butt. I know how to create volumes for attachment to containers, but across hosts? I looked at a few storage plugins but the only one I found that supported multihost is Flocker and it's dead as a doorknob -- the company folded and the Github project hasn't been touched since last year.

If would be great if someone could point me to a plugin with clear instructions on how to set it up, or to another solution? Short of setting up a fourth host with two HD's and using NFS to share across the other three hosts, I'm not sure what to do here.

3 Answers

Well, in this case the problem is that the correct instructions were lost in translation. There was no requirement to connect the persistent storage across hosts, I was only expected to create persistent storage in each host, two volumes that could then be used by containers. Once I got that clarification, I realized I had already completed the requirement.

From my search I also realized there isn't really any good way to connect persistent local volumes across hosts for use by Docker containers in a high availability configuration, not without getting into a lot of complexity that defeats the purpose.

Related