This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag

Homepage

About Us

Contact Us

Legal Info

How To Contribute

Security Issues

18 August 2008 Heartbeat release 2.1.4 is now out Download it and install it!

11 October 2007 NEW educational HA/DR Blog hosted by Alan Robertson

9 April 2007 Check out the Cool Heartbeat Screencasts: Installation, Intro to the GUI Part of the Heartbeat Education project

Last site update:
2008-08-28 03:53:18

Constraints

The version 1 implementation of the ResourceManager, as well as only allowing ResourceAllocation across 2 ClusterNodes, used the ResourceGroup model.

The new ClusterResourceManager is taking the more flexible approach of using constraints (also known as dependencies).

Although some people may not wish to take advantage of this extra functionality, the old ResourceGroup model can easily be mapped to the new model but this will not be done internally to Heartbeat or in the provided command line interface AdminTools. Instead it is envisioned that a GUI will be made available that presents the configuration as a ResourceGroup to the user and creates the required constraints.

Short Example

Existing entry in haresources

hadev 127.0.0.10 drbd:/mnt/web apache

Equivalent Pseudo ClusterInformationBase

Disclaimer: This is not how it is actually represented, it is for demonstration purposes only.

Resources

<resource name> { <resource type>, <resource arg(s)> { <node> = <priority>, ... } }

resource1 { IPAddr, 127.0.0.10 { hadev = 100, secondary = 10, tertiary = 1 } }

resource2 { drbd, /mnt/web { hadev = 100, secondary = 10 } }

resource3 { apache { hadev = 100, secondary = 10, tertiary = 1 } }

Constraints

<constraint name> { <resource name>, <constraint type> { <constraint arg(s) - in this case another resource name> } }

constraint2_1 { resource2, same_node_after { resource1 } }

constraint3_2 { resource3, same_node_after { resource2 } }

Detail

Types of Constraints

Constraints fall into the following three categories.

  • Ordering constraints
    These affect the order in which resources are started and stopped in the cluster.
    Example: Start Apache after DRBD

  • Direct locational constraints
    These affect where resources are run in the cluster. By default resources can not run anywhere and a constraint must be present to associate resources and nodes. It is possible to associate a resource with all nodes in the cluster - see the 3rd example below.
    Examples:

    • Apache can run on nodes named A, B, C.
    • DRBD can not run on any node where kernel=2.6
    • MySQL can run on <any>

  • Indirect locational constraints
    These determine where a resource is run in the cluster relative to other resources.
    Examples:

    • Apache must run on the same node as DRBD
    • Apache should not run on the same node as MySQL

See the CRM DTD for the specification of each constraint type.