
A common configuration is that of a high-availability server which simply provides two IP addresses (1.2.3.4, and 1.2.3.5) to be failed over[1] between the node[2]s of our cluster[3]. We will set this up as an active/active[4] configuration.
logfacility daemon # Log to syslog as facility "daemon" node paul silas # List our cluster members keepalive 1 # Send one heartbeat each second deadtime 10 # Declare nodes dead after 10 seconds bcast eth0 eth1 # Broadcast heartbeats on eth0 and eth1 interfaces ping 1.2.3.254 # Ping our router to monitor ethernet connectivity auto_failback yes # Try and keep resources on their "preferred" hosts respawn hacluster /usr/lib/heartbeat/ipfail # Failover on network failures
See the ipfail[5] page for more information on ipfail[5].
paul 1.2.3.4 silas 1.2.3.5
The first word (paul or silas) on the line represents the "preferred[6]" host for the service. The remainder of the line is the list of resource[7]s (services) which are part of this ResourceGroup[8]. In this case, each ResourceGroup[8] consists of only one resource[7] -- an IP address. 1.2.3.4 is a shorthand notation for IPaddr::1.2.3.4, and 1.2.3.5 is a similar shorthand for IPaddr::1.2.3.5.
Because auto_failback[9] was enabled, when paul joins the cluster it will regain the 1.2.3.4 address. Similarly, when silas joins the cluster, it will regain its (1.2.3.5) service address. If an active/passive[10] configuration is desired, then simply change auto_failback[9] to no.
/etc/ha.d/authkeys[11] must be mode 600. See the section on GeneratingAuthkeysAutomatically[12] for information how to generate good keys automatically.
auth 1 1 sha1 PutYourSuperSecretKeyHere
ha.cf[13], haresources[14], authkeys[11], AddressFailover[15], GettingStarted/OneIPAddress[16], An Active/Active Two IP address Configuration for version 2[17]
| [1] | http://en.wikipedia.org/wiki/Failover |
| [2] | http://www.linux-ha.org/node |
| [3] | http://en.wikipedia.org/wiki/Computer_cluster |
| [4] | http://www.linux-ha.org/ActiveActive |
| [5] | http://www.linux-ha.org/ipfail |
| [6] | http://www.linux-ha.org/PreferredNode |
| [7] | http://www.linux-ha.org/resource |
| [8] | http://www.linux-ha.org/ResourceGroup |
| [9] | http://www.linux-ha.org/ha.cf/AutoFailbackDirective |
| [10] | http://www.linux-ha.org/ActivePassive |
| [11] | http://www.linux-ha.org/authkeys |
| [12] | http://www.linux-ha.org/GeneratingAuthkeysAutomatically |
| [13] | http://www.linux-ha.org/ha.cf |
| [14] | http://www.linux-ha.org/haresources |
| [15] | http://www.linux-ha.org/AddressFailover |
| [16] | http://www.linux-ha.org/GettingStarted/OneIPAddress |
| [17] | http://www.linux-ha.org/GettingStartedV2/TwoIPaddresses |
This information provided courtesy of the Linux-HA project at http://linux-ha.org/