I did a custom build of the Sheepdog package (the building of which I still need to document), but the installation went along the lines of:
apt install libzookeeper-mt2 apt install corosync libcorosync-common-dev dpkg -i /home/rburkholder/sheepdog_1.0+169.g65958e35-1_amd64.deb
Configuration for Sheepdog, is simple, and on a Debian Stretch machine, resides in /etc/default/sheepdog. Mine, I think, is pretty much default for now.
# start sheepdog at boot [yes|no] START="yes" # Arguments to run the daemon with # Options: # -p, --port specify the TCP port on which to listen # -l, --loglevel specify the level of logging detail # -d, --debug include debug messages in the log # -D, --directio use direct IO when accessing the object store # -z, --zone specify the zone id # -c, --cluster specify the cluster driver DAEMON_ARGS="-b 0.0.0.0 -c corosync -l dir=/var/log/,level=debug,format=server" # SHEEPDOG_PATH # Proper LSB systems will store sheepdog files in /var/lib/sheepdog. The init script uses this directory by default. # The directory must be on a filesystem with xattr support. In the case of ext3, user_xattr should be added to the # mount options. # # mount -o remount,user_xattr /var/lib/shepdog SHEEPDOG_PATH="/var/lib/sheepdog"
For use with libvirt, there is a fix to perform on a soft link:
rm /usr/sbin/collie ln -s /usr/bin/dog /usr/sbin/collie
Once the corosync and sheepdog services are configured and running, sheepdog only needs one more command: format the cluster. I used the Erasure Code Support mechanism. The trick here, is based upon the directory (by default '/var/lib/sheepdog') as set in initialization scripts, is where the format command gets applied.
# dog cluster format -c 2:1 # dog cluster info -v Cluster status: running, auto-recovery enabled Cluster store: plain with 2:1 redundancy policy Cluster vnodes strategy: auto Cluster vnode mode: node Cluster created at Tue Oct 31 16:12:13 2017 Epoch Time Version [Host:Port:V-Nodes,,,] 2017-10-31 16:12:13 1 [172.16.1.21:7000:128, 172.16.1.22:7000:128, 172.16.1.23:7000:128]
# dog node list Id Host:Port V-Nodes Zone 0 172.16.1.21:7000 128 352389386 1 172.16.1.22:7000 128 369166602 2 172.16.1.23:7000 128 385943818
This simple setup provides the block storage space to be used by libvirt and the virtualization guests under its control.