lizardfs/lizardfs — pull request #184 by Zorlin (2014-10-08 23:43:09+00:00)
Title: Add lizardfs-cluster init script to manage cluster state for HA

This represents some early work on making a proper, official HA solution for LizardFS.

We propose using Corosync combined with this init script to manage the promotion and demotion of masters and shadow masters.

Steps to test it out:
* Install corosync and pacemaker: sudo apt-get install corosync pacemaker
* Generate a key: sudo corosync-keygen
* Copy that key to every host as /etc/corosync/authkey
* Open /etc/corosync/corosync.conf and changed mcastaddr IP to 226.94.1.1 and bind IP to 10.1.21.0 (or whatever subnet you want to run your cluster on)
* Change /etc/default/corosync to "yes" on all hosts
* Check the state of the cluster: sudo crm_mon -1 - it should show all nodes as part of the cluster.
* Disable STONITH: sudo crm configure property stonith-enabled=false
* Create the primitive for the failover IP (use your own IP if you want a different one): sudo crm configure primitive failover-ip ocf:heartbeat:IPaddr2 params ip=10.1.21.200 cidr_netmask=24 op monitor interval=0.15s
* Change resource stickiness to prevent unnecessary movement: sudo crm configure rsc_defaults resource-stickiness=100
* If you have less than 3 hosts, disable quorum handling: sudo crm configure property no-quorum-policy=ignore
* Finally, add a primitive that represents the cluster: sudo crm configure primitive lizardfs-cluster lsb:lizardfs-cluster
* And make the failover-ip follow that: sudo crm configure colocation col_lizardfs-cluster_failover-ip inf: failover-ip lizardfs-cluster