
The most common, basic configuration is that of a high-availability server which simply provides a single IP address (1.2.3.4) to be failed over[1] between the nodes[2] of our cluster[3]. This is an ActivePassive[4] configuration - the most basic configuration.
This is for Heartbeat[5] 1.2.x
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 no # Don't fail back to paul automatically respawn hacluster /usr/lib/heartbeat/ipfail # Failover on network failures
This is for Heartbeat[5] 2.0.x[6] without CRM[7]
logfacility daemon keepalive 1 deadtime 10 warntime 5 initdead 120 # depend on your hardware udpport 694 ping 1.2.3.254 bcast eth0 auto_failback off node paul node silas respawn hacluster /usr/lib/heartbeat/ipfail use_logd yes
This is for Heartbeat[5] 2.0.x[6] with CRM[7]
logfacility daemon keepalive 1 deadtime 10 warntime 5 initdead 120 # depend on your hardware udpport 694 ping 1.2.3.254 bcast eth0 auto_failback off node paul node silas use_logd yes compression bz2 compression_threshold 2 crm yes
See the ipfail[8] page for more information on ipfail[8].
If you want less broadcast traffic, use ucast[9], which is strictly peer-to-peer. bcast[10] is limited to the logical segment and not routed, while ucast[9]/mcast[11] are potentially routed. ucast[9] duplicates the packets, as it has to be sent to each node and not just broad/multicasted to all of them at the same time.
For Heartbeat[5] version 2[6] with CRM[7], you'll need to modify cib.xml instead of this file. Please see the Basic Single IP address Configuration for version 2[12] page for details.
paul 1.2.3.4
The first word (paul) on the line represents the "preferred[13]" host for the service. The remainder of the line is the list of resource[14]s (services) which are part of this ResourceGroup[15]. In this case, there is only one resource[14] -- an IP address. This is a shorthand notation for IPaddr::1.2.3.4. There are many possible variants of how to specify the IP address, to learn about them, see the page on the IPaddr resource agent[16].
Note that this address cannot be used for anything else on these machines. In particular, it has to be controlled only by Heartbeat[5], and cannot be brought up by your operating system at boot time. We call this address a ServiceAddress[17] - which is distinct from an AdministrativeAddress[18], like those brought up by your operating system.
/etc/ha.d/authkeys[19] must be mode 600. See the section on GeneratingAuthkeysAutomatically[20] for information how to generate good keys automatically.
auth 1 1 sha1 PutYourSuperSecretKeyHere
ha.cf[21], haresources[22], authkeys[19], AddressFailover[23], GettingStarted/TwoIPaddresses[24], A Basic Single IP address Configuration for version 2[12]
| [1] | http://en.wikipedia.org/wiki/Failover |
| [2] | http://www.linux-ha.org/ClusterNode |
| [3] | http://en.wikipedia.org/wiki/Computer_cluster |
| [4] | http://www.linux-ha.org/ActivePassive |
| [5] | http://www.linux-ha.org/Heartbeat |
| [6] | http://www.linux-ha.org/v2 |
| [7] | http://www.linux-ha.org/ClusterResourceManager |
| [8] | http://www.linux-ha.org/ipfail |
| [9] | http://www.linux-ha.org/ha.cf/UcastDirective |
| [10] | http://www.linux-ha.org/ha.cf/BcastDirective |
| [11] | http://www.linux-ha.org/ha.cf/McastDirective |
| [12] | http://www.linux-ha.org/GettingStartedV2/OneIPAddress |
| [13] | http://www.linux-ha.org/PreferredNode |
| [14] | http://www.linux-ha.org/resource |
| [15] | http://www.linux-ha.org/ResourceGroup |
| [16] | http://www.linux-ha.org/HeartbeatResourceAgent/IPaddr |
| [17] | http://www.linux-ha.org/ServiceAddress |
| [18] | http://www.linux-ha.org/AdministrativeAddress |
| [19] | http://www.linux-ha.org/authkeys |
| [20] | http://www.linux-ha.org/GeneratingAuthkeysAutomatically |
| [21] | http://www.linux-ha.org/ha.cf |
| [22] | http://www.linux-ha.org/haresources |
| [23] | http://www.linux-ha.org/AddressFailover |
| [24] | http://www.linux-ha.org/GettingStarted/TwoIPaddresses |
This information provided courtesy of the Linux-HA project at http://linux-ha.org/