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.