Linux-HA Logo

hb_standby

This is a simple shell script that issues a failover[1] from the node[2] where it is running to the other node, if available. It is useful to interface with an external resource monitor, such as mon[3] or Nagios[4], or any home-made-monitor-script.

hb_standby is a script that allows manual control of which node is controlling what resources[5] at a given time. When the "standby" option is provided to the Heartbeat init script, it calls hb_standby with the "all" option.

    usage: hb_standby [all|foreign|local|failback]

The full path is usually /usr/lib/heartbeat/hb_standby. To get a list of the options to hb_standby issue the command, "/usr/lib/heartbeat/hb_standby --help". NOTE: For historical reasons, unlike most scripts where failure to specify an option gives you the list of possible options, failure to provide an option to hb_standby is equivalent to "hb_standby all".

The meaning of the options is relative. For this sample haresources[6] file (IMPORTANT: all resources for one node on one line):

nodea drbddisk::r0 Filesystem::/dev/drbd0::/local/groups::ext3 10.0.0.1 smb
nodeb drbddisk::r1 Filesystem::/dev/drbd1::/local/ldap::ext3 10.0.0.2 ldap

hb_standby local

When run on nodea, means migrate any resources that nodea is the preferred node[7] for. In this case Samba would be shutdown, the IP address 10.0.0.1 would be released, /local/groups would be unmounted, /dev/drbd0 would be placed into secondary and nodeb would take all these services over.

When run on nodeb, OpenLDAP would shutdown, 10.0.0.2 would be released, /local/ldap would be unmounted, /dev/drbd1 would be placed into Secondary mode and nodea would take over all these services.

hb_standby foreign

When run on nodea, means migrate any resources that nodea is NOT the preferred node[7] for. In this case OpenLDAP would shutdown, 10.0.0.2 would be released, /local/ldap would be unmounted, /dev/drbd1 would be placed into Secondary mode and nodeb would take over all these services.

When run on nodeb, Samba would be shutdown, the IP address 10.0.0.1 would be released, /local/groups would be unmounted, /dev/drbd0 would be placed into secondary and nodea would take all these services over.

hb_standby all

Regardless of which node it's run on means to release all resources so the other node takes over all resources.

hb_standby

Without an argument is the same as "hb_standby all"

hb_standby failback

Same as "hb_standby foreign"

See Also

haresources[6], hb_takeover[8], cl_status[9], mon[3], failback[10]


References

[1]http://en.wikipedia.org/wiki/Failover
[2]http://www.linux-ha.org/ClusterNode
[3]http://www.linux-ha.org/mon
[4]http://en.wikipedia.org/wiki/Nagios
[5]http://www.linux-ha.org/resource
[6]http://www.linux-ha.org/haresources
[7]http://www.linux-ha.org/PreferredNode
[8]http://www.linux-ha.org/hb_takeover
[9]http://www.linux-ha.org/cl_status
[10]http://www.linux-ha.org/failback


This information provided courtesy of the Linux-HA project at http://linux-ha.org/