5.5. Resource Configuration

A resource is a single physical or logical entity that provides a service to clients or other resources. A resource is generally available for use on two or more nodes in a cluster, although only one node controls the resource at any given time. For example, a resource can be a single disk volume, a particular network address, or an application such as a web node.

5.5.1. Defining Resources

Resources are identified by a resource name and a resource type. A resource name identifies a specific instance of a resource type. A resource type is a particular class of resource. All of the resources in a given resource type can be handled in the same way for the purposes of failover. Every resource is an instance of exactly one resource type.

A resource type is identified with a simple name. A resource type can be defined for a specific logical node, or it can be defined for an entire cluster. A resource type that is defined for a node will override a clusterwide resource type definition of the same name; this allows an individual node to override global settings from a clusterwide resource type definition.

The Linux FailSafe software includes many predefined resource types. If these types fit the application you want to make into a highly available service, you can reuse them. If none fit, you can define additional resource types.

To define a resource, you provide the following information:

You can define up to 100 resources in a Linux FailSafe configuration.

5.5.1.1. IP Address Resource Attributes

The IP Address resources are the IP addresses used by clients to access the highly available services within the resource group. These IP addresses are moved from one node to another along with the other resources in the resource group when a failure is detected.

You specify the resource name of an IP address in dotted decimal notation. IP names that require name resolution should not be used. For example, 192.26.50.1 is a valid resource name of the IP Address resource type.

The IP address you define as a Linux FailSafe resource must not be the same as the IP address of a node hostname or the IP address of a node's control network.

When you define an IP address, you can optionally specifying the following parameters. If you specify any of these parameters, you must specify all of them.

  • The broadcast address for the IP address.

  • The network mask of the IP address.

  • A comma-separated list of interfaces on which the IP address can be configured. This ordered list is a superset of all the interfaces on all nodes where this IP address might be allocated. Hence, in a mixed cluster with different ethernet drivers, an IP address might be placed on eth0 on one system and ln0 on a another. In this case the interfaces field would be eth0,ln0 or ln0,eth0.

    The order of the list of interfaces determines the priority order for determining which IP address will be used for local restarts of the node.

5.5.2. Adding Dependency to a Resource

One resource can be dependent on one or more other resources; if so, it will not be able to start (that is, be made available for use) unless the dependent resources are started as well. Dependent resources must be part of the same resource group.

Like resources, a resource type can be dependent on one or more other resource types. If such a dependency exists, at least one instance of each of the dependent resource types must be defined. For example, a resource type named Netscape_web might have resource type dependencies on a resource types named IP_address and volume. If a resource named ws1 is defined with the Netscape_web resource type, then the resource group containing ws1 must also contain at least one resource of the type IP_address and one resource of the type volume.

You cannot make resources mutually dependent. For example, if resource A is dependent on resource B, then you cannot make resource B dependent on resource A. In addition, you cannot define cyclic dependencies. For example, if resource A is dependent on resource B, and resource B is dependent on resource C, then resource C cannot be dependent on resource A.

When you add a dependency to a resource definition, you provide the following information:

5.5.2.1. Defining a Resource with the Cluster Manager GUI

To define a resource with the Cluster Manager GUI, perform the following steps:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Define a New Resource” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task.

  6. On the right side of the display, click on the “Add/Remove Dependencies for a Resource Definition” to launch the task.

  7. Enter the selected inputs.

  8. Click on “OK” at the bottom of the screen to complete the task.

When you use this command to define a resource, you define a cluster-wide resource that is not specific to a node. For information on defining a node-specific resource, see Section 5.5.3.

5.5.2.2. Defining a Resource with the Cluster Manager CLI

Use the following CLI command to define a clusterwide resource:

cmgr> define resourceA [of resource_typeB] [in clusterC]

Entering this command specifies the name and resource type of the resource you are defining within a specified cluster. If you have specified a default cluster or a default resource type, you do not need to specify a resource type or a cluster in this command and the CLI will use the default.

When you use this command to define a resource, you define a clusterwide resource that is not specific to a node. For information on defining a node-specific resource, see Section 5.5.3.

The following prompt appears:

resource A?

When this prompt appears during resource creation, you can enter the following commands to specify the attributes of the resource you are defining and to add and remove dependencies from the resource:

resource A? setkeytovalue
resource A? add dependencyEof typeF
resource A? remove dependencyEof typeF

The attributes you define with the set key to value command will depend on the type of resource you are defining, as described in Section 5.5.1.

For detailed information on how to determine the format for defining resource attributes, see Section 5.5.2.3.

When you are finished defining the resource and its dependencies, enter done to return to the cmgr prompt.

5.5.2.3. Specifying Resource Attributes with Cluster Manager CLI

To see the format in which you can specify the user-specific attributes that you need to set for a particular resource type, you can enter the following command to see the full definition of that resource type:

cmgr> show resource_type Ain clusterB

For example, to see the key attributes you define for a resource of a defined resource type IP_address, you would enter the following command:

cmgr>  show resource_type IP_address in cluster nfs-cluster

Name: IP_address
Predefined: true
Order: 401
Restart mode: 1
Restart count: 2

Action name: stop
        Executable: /usr/lib/failsafe/resource_types/IP_address/stop
        Maximum execution time: 80000ms
        Monitoring interval: 0ms
        Start monitoring time: 0ms
Action name: exclusive
        Executable: /usr/lib/failsafe/resource_types/IP_address/exclusive
        Maximum execution time: 100000ms
        Monitoring interval: 0ms
        Start monitoring time: 0ms
Action name: start
        Executable: /usr/lib/failsafe/resource_types/IP_address/start
        Maximum execution time: 80000ms
        Monitoring interval: 0ms
        Start monitoring time: 0ms
Action name: restart
        Executable: /usr/lib/failsafe/resource_types/IP_address/restart
        Maximum execution time: 80000ms
        Monitoring interval: 0ms
        Start monitoring time: 0ms
Action name: monitor
        Executable: /usr/lib/failsafe/resource_types/IP_address/monitor
        Maximum execution time: 40000ms
        Monitoring interval: 20000ms
        Start monitoring time: 50000ms

Type specific attribute: NetworkMask
        Data type: string
Type specific attribute: interfaces
        Data type: string
Type specific attribute: BroadcastAddress
        Data type: string

No resource type dependencies

The display reflects the format in which you can specify the group id, the device owner, and the device file permissions for the volume. In this case, the devname-group key specifies the group id of the device file, the devname_owner key specifies the owner of the device file, and the devname_mode key specifies the device file permissions.

For example, to set the group id to sys, enter the following command:

resource A? set devname-group to sys

This remainder of this section summarizes the attributes you specify for the predefined Linux FailSafe resource types with the set key to value command of the Cluster Manger CLI.

When you define an IP address, you specify the following attributes:

NetworkMask

The subnet mask of the IP address

interfaces

A comma-separated list of interfaces on which the IP address can be configured

BroadcastAddress

The broadcast address for the IP address

5.5.3. Defining a Node-Specific Resource

You can redefine an existing resource with a resource definition that applies only to a particular node. Only existing clusterwide resources can be redefined; resources already defined for a specific cluster node cannot be redefined.

You use this feature when you configure heterogeneous clusters for an IP_address resource. For example, IP_address 192.26.50.2 can be configured on et0 on an SGI Challenge node and on eth0 on all other Linux servers. The clusterwide resource definition for 192.26.50.2 will have the interfaces field set to eth0 and the node-specific definition for the Challenge node will have et0 as the interfaces field.

5.5.3.1. Defining a Node-Specific Resource with the Cluster Manager GUI

Using the Cluster Manager GUI, you can take an existing clusterwide resource definition and redefine it for use on a specific node in the cluster:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Redefine a Resource For a Specific Node” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task.

5.5.3.2. Defining a Node-Specific Resource with the Cluster Manager CLI

You can use the Cluster Manager CLI to redefine a clusterwide resource to be specific to a node just as you define a clusterwide resource, except that you specify a node on the define resource command.

Use the following CLI command to define a node-specific resource:

cmgr> define resourceAof resource_typeBon nodeC [in clusterD]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

5.5.4. Modifying and Deleting Resources

After you have defined resources, you can modify and delete them.

You can modify only the type-specific attributes for a resource. You cannot rename a resource once it has been defined.

Note: There are some resource attributes whose modification does not take effect until the resource group containing that resource is brought online again. For example, if you modify the export options of a resource of type NFS, the modifications do not take effect immediately; they take effect when the resource is brought online.

5.5.4.1. Modifying and Deleting Resources with the Cluster Manager GUI

To modify a resource with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Modify a Resource Definition” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

To delete a resource with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Delete a Resource” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

5.5.4.2. Modifying and Deleting Resources with the Cluster Manager CLI

Use the following CLI command to modify a resource:

cmgr> modify resourceAof resource_typeB [in clusterC]

Entering this command specifies the name and resource type of the resource you are modifying within a specified cluster. If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

You modify a resource using the same commands you use to define a resource.

You can use the following command to delete a resource definition:

cmgr> delete resourceAof resource_typeB [in clusterD]

5.5.5. Displaying Resources

You can display resources in various ways. You can display the attributes of a particular defined resource, you can display all of the defined resources in a specified resource group, or you can display all the defined resources of a specified resource type.

5.5.5.1. Displaying Resources with the Cluster Manager GUI

The Cluster Manager GUI provides a convenient display of resources through the FailSafe Cluster View. You can launch the FailSafe Cluster View directly, or you can bring it up at any time by clicking on the “FailSafe Cluster View” button at the bottom of the “FailSafe Manager” display.

From the View menu of the FailSafe Cluster View, select Resources to see all defined resources. The status of these resources will be shown in the icon (green indicates online, grey indicates offline). Alternately, you can select “Resources of Type” from the View menu to see resources organized by resource type, or you can select “Resources by Group” to see resources organized by resource group.

5.5.5.2. Displaying Resources with the Cluster Manager CLI

Use the following command to view the parameters of a defined resource:

cmgr> show resource A of resource_type B

Use the following command to view all of the defined resources in a resource group:

cmgr> show resources in resource_groupA [in clusterB]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

Use the following command to view all of the defined resources of a particular resource type in a specified cluster:

cmgr> show resources of resource_typeA [in clusterB]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

5.5.6. Defining a Resource Type

The Linux FailSafe software includes many predefined resource types. If these types fit the application you want to make into a highly available service, you can reuse them. If none fits, you can define additional resource types.

Complete information on defining resource types is provided in the Linux FailSafe Programmer's Guide. This manual provides a summary of that information.

To define a new resource type, you must have the following information:

To define a new resource type, you use the Cluster Manager GUI or the Cluster Manager CLI.

5.5.6.1. Defining a Resource Type with the Cluster Manager GUI

To define a resource type with the Cluster Manager GUI, perform the following steps:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Define a Resource Type” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task.

5.5.6.2. Defining a Resource Type with the Cluster Manager CLI

The following steps show the use of cluster_mgr interactively to define a resource type called test_rt.

  1. Log in as root.

  2. Execute the cluster_mgr command using the -p option to prompt you for information (the command name can be abbreviated to cmgr):

    # /usr/lib/failsafe/bin/cluster_mgr -p
    Welcome to Linux FailSafe Cluster Manager Command-Line Interface
    
    cmgr>
  3. Use the set subcommand to specify the default cluster used for cluster_mgr operations. In this example, we use a cluster named test:

    cmgr> set cluster test

    Note: If you prefer, you can specify the cluster name as needed with each subcommand.

  4. Use the define resource_type subcommand. By default, the resource type will apply across the cluster; if you wish to limit the resource_type to a specific node, enter the node name when prompted. If you wish to enable restart mode, enter 1 when prompted.

    Note:  The following example only shows the prompts and answers for two action scripts (start and stop) for a new resource type named test_rt.

    cmgr> define resource_type test_rt
    
    (Enter "cancel" at any time to abort)
    
    Node[optional]?
    Order ? 300
    Restart Mode ? (0)
    
    DEFINE RESOURCE TYPE OPTIONS
    
            0) Modify Action Script.
            1) Add Action Script.
            2) Remove Action Script.
            3) Add Type Specific Attribute.
            4) Remove Type Specific Attribute.
            5) Add Dependency.
            6) Remove Dependency.
            7) Show Current Information.
            8) Cancel. (Aborts command)
            9) Done. (Exits and runs command)
    
    Enter option:1
    
    No current resource type actions
    
    Action name ? start
    Executable Time? 40000
    Monitoring Interval? 0
    Start Monitoring Time? 0
    
            0) Modify Action Script.
            1) Add Action Script.
            2) Remove Action Script.
            3) Add Type Specific Attribute.
            4) Remove Type Specific Attribute.
            5) Add Dependency.
            6) Remove Dependency.
            7) Show Current Information.
            8) Cancel. (Aborts command)
            9) Done. (Exits and runs command)
    
    Enter option:1
    
    Current resource type actions:
            Action - 1: start
    
    Action name stop
    Executable Time? 40000
    Monitoring Interval? 0
    Start Monitoring Time? 0 
    
            0) Modify Action Script.
            1) Add Action Script.
            2) Remove Action Script.
            3) Add Type Specific Attribute.
            4) Remove Type Specific Attribute.
            5) Add Dependency.
            6) Remove Dependency.
            7) Show Current Information.
            8) Cancel. (Aborts command)
            9) Done. (Exits and runs command)
    
    Enter option:3
    
    No current type specific attributes
    
    Type Specific Attribute ? integer-att
    Datatype ? integer
    Default value[optional] ? 33
    
            0) Modify Action Script.
            1) Add Action Script.
            2) Remove Action Script.
            3) Add Type Specific Attribute.
            4) Remove Type Specific Attribute.
            5) Add Dependency.
            6) Remove Dependency.
            7) Show Current Information.
            8) Cancel. (Aborts command)
            9) Done. (Exits and runs command)
    
    Enter option:3
    
    Current type specific attributes:
            Type Specific Attribute - 1: export-point
    
    Type Specific Attribute ? string-att
    Datatype ? string
    Default value[optional] ? rw
    
            0) Modify Action Script.
            1) Add Action Script.
            2) Remove Action Script.
            3) Add Type Specific Attribute.
            4) Remove Type Specific Attribute.
            5) Add Dependency.
            6) Remove Dependency.
            7) Show Current Information.
            8) Cancel. (Aborts command)
            9) Done. (Exits and runs command)Enter option:5
    
    No current resource type dependencies
    
    Dependency name ? filesystem
    
            0) Modify Action Script.
            1) Add Action Script.
            2) Remove Action Script.
            3) Add Type Specific Attribute.
            4) Remove Type Specific Attribute.
            5) Add Dependency.
            6) Remove Dependency.
            7) Show Current Information.
            8) Cancel. (Aborts command)
            9) Done. (Exits and runs command)
    
    Enter option:7
    
    Current resource type actions:
            Action - 1: start
            Action - 2: stop
    
    Current type specific attributes:
            Type Specific Attribute - 1: integer-att
            Type Specific Attribute - 2: string-att
    
    No current resource type dependencies
    
    Resource dependencies to be added:
            Resource dependency - 1: filesystem
    
            0) Modify Action Script.
            1) Add Action Script.
            2) Remove Action Script.
            3) Add Type Specific Attribute.
            4) Remove Type Specific Attribute.
            5) Add Dependency.
            6) Remove Dependency.
            7) Show Current Information.
            8) Cancel. (Aborts command)
            9) Done. (Exits and runs command)
    
    Enter option:9
    Successfully created resource_type test_rt
    
    cmgr> show resource_types
    
    NFS
    template
    Netscape_web
    test_rt
    statd
    Oracle_DB
    MAC_address
    IP_address
    INFORMIX_DB
    filesystem
    volume
    
    cmgr> exit
    #

5.5.7. Defining a Node-Specific Resource Type

You can redefine an existing resource type with a resource definition that applies only to a particular node. Only existing clusterwide resource types can be redefined; resource types already defined for a specific cluster node cannot be redefined.

A resource type that is defined for a node overrides a cluster-wide resource type definition with the same name; this allows an individual node to override global settings from a clusterwide resource type definition. You can use this feature if you want to have different script timeouts for a node or you want to restart a resource on only one node in the cluster.

For example, the IP_address resource has local restart enabled by default. If you would like to have an IP address type without local restart for a particular node, you can make a copy of the IP_address clusterwide resource type with all of the parameters the same except for restart mode, which you set to 0.

5.5.7.1. Defining a Node-Specific Resource Type with the Cluster Manager GUI

Using the Cluster Manager GUI, you can take an existing clusterwide resource type definition and redefine it for use on a specific node in the cluster. Perform the following tasks:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Redefine a Resource Type For a Specific Node” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task.

5.5.7.2. Defining a Node-Specific Resource Type with the Cluster Manager CLI

With the Cluster Manager CLI, you redefine a node-specific resource type just as you define a cluster-wide resource type, except that you specify a node on the define resource_type command.

Use the following CLI command to define a node-specific resource type:

cmgr> define resource_typeAon nodeB [in clusterC]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

5.5.8. Adding Dependencies to a Resource Type

Like resources, a resource type can be dependent on one or more other resource types. If such a dependency exists, at least one instance of each of the dependent resource types must be defined. For example, a resource type named Netscape_web might have resource type dependencies on a resource type named IP_address and volume. If a resource named ws1 is defined with the Netscape_web resource type, then the resource group containing ws1 must also contain at least one resource of the type IP_address nd one resource of the type volume.

When using the Cluster Manager GUI, you add or remove dependencies for a resource type by selecting the “Add/Remove Dependencies for a Resource Type” from the “Resources & Resource Types” display and providing the indicated input. When using the Cluster Manager CLI, you add or remove dependencies when you define or modify the resource type.

5.5.9. Modifying and Deleting Resource Types

After you have defined a resource types, you can modify and delete them.

5.5.9.1. Modifying and Deleting Resource Types with the Cluster Manager GUI

To modify a resource type with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Modify a Resource Type Definition” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

To delete a resource type with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Resources & Resource Types” category.

  3. On the right side of the display click on the “Delete a Resource Type” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

5.5.9.2. Modifying and Deleting Resource Types with the Cluster Manager CLI

Use the following CLI command to modify a resource:

cmgr> modify resource_typeA [in clusterB]

Entering this command specifies the resource type you are modifying within a specified cluster. If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

You modify a resource type using the same commands you use to define a resource type.

You can use the following command to delete a resource type:

cmgr> delete resource_typeA [in clusterB]

5.5.10. Installing (Loading) a Resource Type on a Cluster

When you define a cluster, Linux FailSafe installs a set of resource type definitions that you can use that include default values. If you need to install additional standard Silicon Graphics-supplied resource type definitions on the cluster, or if you delete a standard resource type definition and wish to reinstall it, you can load that resource type definition on the cluster.

The resource type definition you are installing cannot exist on the cluster.

5.5.10.1. Installing a Resource Type with the Cluster Manager GUI

To install a resource type using the GUI, select the “Load a Resource” task from the “Resources & Resource Types” task page and enter the resource type to load.

5.5.10.2. Installing a Resource Type with the Cluster Manager CLI

Use the following CLI command to install a resource type on a cluster:

cmgr> install resource_typeA [in clusterB]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

5.5.11. Displaying Resource Types

After you have defined a resource types, you can display them.

5.5.11.1. Displaying Resource Types with the Cluster Manager GUI

The Cluster Manager GUI provides a convenient display of resource types through the FailSafe Cluster View. You can launch the FailSafe Cluster View directly, or you can bring it up at any time by clicking on the “FailSafe Cluster View” prompt at the bottom of the “FailSafe Manager” display.

From the View menu of the FailSafe Cluster View, select Types to see all defined resource types. You can then click on any of the resource type icons to view the parameters of the resource type.

5.5.11.2. Displaying Resource Types with the Cluster Manager CLI

Use the following command to view the parameters of a defined resource type in a specified cluster:

cmgr> show resource_type A [in clusterB]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

Use the following command to view all of the defined resource types in a cluster:

cmgr> show resource_types [in clusterA]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

Use the following command to view all of the defined resource types that have been installed:

cmgr> show resource_typesinstalled

5.5.12. Defining a Failover Policy

Before you can configure your resources into a resource group, you must determine which failover policy to apply to the resource group. To define a failover policy, you provide the following information:

Complete information on failover policies and failover scripts, with an emphasis on writing your own failover policies and scripts, is provided in the Linux FailSafe Programmer's Guide.

5.5.12.1. Failover Scripts

A failover script helps determine the node that is chosen for a failed resource group. The failover script takes the initial failover domain and transforms it into the runtime failover domain. Depending upon the contents of the script, the initial and the runtime domains may be identical.

The ordered failover script is provided with the Linux FailSafe release. The ordered script never changes the initial domain; when using this script, the initial and runtime domains are equivalent.

The round-robin failover script is also provided with the Linux FailSafe release. The round-robin cript selects the resource group owner in a round-robin (circular) fashion. This policy can be used for resource groups that can be run in any node in the cluster.

Failover scripts are stored in the /usr/lib/failsafe/policies directory. If the ordered script does not meet your needs, you can define a new failover script and place it in the /usr/lib/failsafe/policies directory. When you are using the FailSafe GUI, the GUI automatically detects your script and presents it to you as a choice for you to use. You can configure the Linux FailSafe database to use your new failover script for the required resource groups. For information on defining failover scripts, see the Linux FailSafe Programmer's Guide.

5.5.12.2. Failover Domain

A failover domain is the ordered list of nodes on which a given resource group can be allocated. The nodes listed in the failover domain must be within the same cluster; however, the failover domain does not have to include every node in the cluster. The failover domain can be used to statically load balance the resource groups in a cluster.

Examples:

  • In a four-node cluster, two nodes might share a volume. The failover domain of the resource group containing the volume will be the two nodes that share the volume.

  • If you have a cluster of nodes named venus, mercury, and pluto, you could configure the following initial failover domains for resource groups RG1 and RG2:

    • venus, mercury, pluto for RG1

    • pluto, mercury for RG2

When you define a failover policy, you specify the initial failover domain. The initial failover domain is used when a cluster is first booted. The ordered list specified by the initial failover domain is transformed into a runtime failover domain by the failover script. With each failure, the failover script takes the current run-time failover domain and potentially modifies it; the initial failover domain is never used again. Depending on the run-time conditions and contents of the failover script, the initial and run-time failover domains may be identical.

Linux FailSafe stores the run-time failover domain and uses it as input to the next failover script invocation.

5.5.12.3. Failover Attributes

A failover attribute is a value that is passed to the failover script and used by Linux FailSafe for the purpose of modifying the run-time failover domain used for a specific resource group. You can specify a failover attribute of Auto_Failback, Controlled_Failback, Auto_Recovery, or InPlace_Recovery. Auto_Failback and Controlled_Failback are mutually exclusive, but you must specify one or the other. Auto_Recovery and InPlace_Recovery are mutually exclusive, but whether you specify one or the other is optional.

A failover attribute of Auto_Failback specifies that the resource group will be run on the first available node in the runtime failover domain. If the first node fails, the next available node will be used; when the first node reboots, the resource group will return to it. This attribute is best used when some type of load balancing is required.

A failover attribute of Controlled_Failback specifies that the resource group will be run on the first available node in the runtime failover domain, and will remain running on that node until it fails. If the first node fails, the next available node will be used; the resource group will remain on this new node even after the first node reboots.This attribute is best used when client/server applications have expensive recovery mechanisms, such as databases or any application that uses tcp to communicate.

The recovery attributes Auto_Recovery and InPlace_Recovery determine the node on which a resource group will be allocated when its state changes to online and a member of the group is already allocated (such as when volumes are present). Auto_Recovery specifies that the failover policy will be used to allocate the resource group; this is the default recovery attribute if you have specified the Auto_Failback attribute. InPlace_Recovery specifies that the resource group will be allocated on the node that already contains part of the resource group; this is the default recovery attribute if you have specified the Controlled_Failback attribute.

See the Linux FailSafe Programmer's Guide for a full discussions of example failover policies.

5.5.12.4. Defining a Failover Policy with the Cluster Manager GUI

To define a failover policy using the GUI, perform the following steps:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Failover Policies & Resource Groups” category.

  3. On the right side of the display click on the “Define a Failover Policy” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task.

5.5.12.5. Defining a Failover Policy with the Cluster Manager CLI

To define a failover policy, enter the following command at the cmgr prompt to specify the name of the failover policy:

cmgr> define failover_policy A

The following prompt appears:

failover_policy A?

When this prompt appears you can use the following commands to specify the components of a failover policy:

failover_policy A? set attribute to B
failover policy A? set script to C
failover policy A? set domain to D
failover_policy A? 

When you define a failover policy, you can set as many attributes and domains as your setup requires, but executing the add attribute and add domain commands with different values. The CLI also allows you to specify multiple domains in one command of the following format:

failover_policy A? set domain to A B C ...

The components of a failover policy are described in detail in the Linux FailSafe Programmer's Guide and in summary in Section 5.5.12.

When you are finished defining the failover policy, enter done to return to the cmgr prompt.

5.5.13. Modifying and Deleting Failover Policies

After you have defined a failover policy, you can modify or delete it.

5.5.13.1. Modifying and Deleting Failover Policies with the Cluster Manager GUI

To modify a failover policy with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Failover Policies & Resource Groups” category.

  3. On the right side of the display click on the “Modify a Failover Policy Definition” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

To delete a failover policy with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Failover Policies & Resource Groups” category.

  3. On the right side of the display click on the “Delete a Failover Policy” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

5.5.13.2. Modifying and Deleting Failover Policies with the Cluster Manager CLI

Use the following CLI command to modify a failover policy:

cmgr> modify failover_policyA

You modify a failover policy using the same commands you use to define a failover policy.

You can use the following command to delete a failover policy definition:

cmgr> delete failover_policyA

5.5.14. Displaying Failover Policies

You can use Linux FailSafe to display any of the following:

5.5.14.1. Displaying Failover Policies with the Cluster Manager GUI

The Cluster Manager GUI provides a convenient display of failover policies through the FailSafe Cluster View. You can launch the FailSafe Cluster View directly, or you can bring it up at any time by clicking on the “FailSafe Cluster View” prompt at the bottom of the “FailSafe Manager” display.

From the View menu of the FailSafe Cluster View, select Failover Policies to see all defined failover policies.

5.5.14.2. Displaying Failover Policies with the Cluster Manager CLI

Use the following command to view the parameters of a defined failover policy:

cmgr> show failover_policy A

Use the following command to view all of the defined failover policies:

cmgr> show failover policies

Use the following command to view all of the defined failover policy attributes:

cmgr> show failover_policy attributes

Use the following command to view all of the defined failover policy scripts:

cmgr> show failover_policy scripts

5.5.15. Defining Resource Groups

Resources are configured together into resource groups. A resource group is a collection of interdependent resources. If any individual resource in a resource group becomes unavailable for its intended use, then the entire resource group is considered unavailable. Therefore, a resource group is the unit of failover for Linux FailSafe.

For example, a resource group could contain all of the resources that are required for the operation of a web node, such as the web node itself, the IP address with which it communicates to the outside world, and the disk volumes containing the content that it serves.

When you define a resource group, you specify a failover policy. A failover policy controls the behavior of a resource group in failure situations.

To define a resource group, you provide the following information:

Linux FailSafe does not allow resource groups that do not contain any resources to be brought online.

You can define up to 100 resources configured in any number of resource groups.

5.5.15.1. Defining a Resource Group with the Cluster Manager GUI

To define a resource group with the Cluster Manager GUI, perform the following steps:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on “Guided Configuration”.

  3. On the right side of the display click on “Set Up Highly Available Resource Groups” to launch the task link.

  4. In the resulting window, click each task link in turn, as it becomes available. Enter the selected inputs for each task.

  5. When finished, click “OK” to close the taskset window.

5.5.15.2. Defining a Resource Group with the Cluster Manager CLI

To configure a resource group, enter the following command at the cmgr prompt to specify the name of a resource group and the cluster to which the resource group is available:

cmgr> define resource_group A [in cluster B]

Entering this command specifies the name of the resource group you are defining within a specified cluster. If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

The following prompt appears:

Enter commands, when finished enter either "done" or "cancel"
resource_group A?

When this prompt appears you can use the following commands to specify the resources to include in the resource group and the failover policy to apply to the resource group:

resource_group A? add resourceBof resource_typeC
resource_group A? set failover_policy to D

After you have set the failover policy and you have finished adding resources to the resource group, enter done to return to the cmgr prompt.

For a full example of resource group creation using the Cluster Manager CLI, see Section 5.7.

5.5.16. Modifying and Deleting Resource Groups

After you have defined resource groups, you can modify and delete the resource groups. You can change the failover policy of a resource group by specifying a new failover policy associated with that resource group, and you can add or delete resources to the existing resource group. Note, however, that since you cannot have a resource group online that does not contain any resources, Linux FailSafe does not allow you to delete all resources from a resource group once the resource group is online. Likewise, Linux FailSafe does not allow you to bring a resource group online if it has no resources. Also, resources must be added and deleted in atomic units; this means that resources which are interdependent must be added and deleted together.

5.5.16.1. Modifying and Deleting Resource Groups with the Cluster Manager GUI

To modify a failure policy with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Failover Policies & Resource Groups” category.

  3. On the right side of the display click on the “Modify a Resource Group Definition” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

To add or delete resources to a resource group definition with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Failover Policies & Resource Groups” category.

  3. On the right side of the display click on the “Add/Remove Resources in Resource Group” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

To delete a resource group with the Cluster Manager GUI, perform the following procedure:

  1. Launch the FailSafe Manager.

  2. On the left side of the display, click on the “Failover Policies & Resource Groups” category.

  3. On the right side of the display click on the “Delete a Resource Group” task link to launch the task.

  4. Enter the selected inputs.

  5. Click on “OK” at the bottom of the screen to complete the task, or click on “Cancel” to cancel.

5.5.16.2. Modifying and Deleting Resource Groups with the Cluster Manager CLI

Use the following CLI command to modify a resource group:

cmgr> modify resource_group A [in cluster B]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default. You modify a resource group using the same commands you use to define a failover policy:

resource_group A? add resourceBof resource_typeC
resource_group A? set failover_policy to D

You can use the following command to delete a resource group definition:

cmgr> delete resource_group A [in cluster B]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

5.5.17. Displaying Resource Groups

You can display the parameters of a defined resource group, and you can display all of the resource groups defined for a cluster.

5.5.17.1. Displaying Resource Groups with the Cluster Manager GUI

The Cluster Manager GUI provides a convenient display of resource groups through the FailSafe Cluster View. You can launch the FailSafe Cluster View directly, or you can bring it up at any time by clicking on the “FailSafe Cluster View” prompt at the bottom of the “FailSafe Manager” display.

From the View menu of the FailSafe Cluster View, select Groups to see all defined resource groups.

To display which nodes are currently running which groups, select “Groups owned by Nodes.” To display which groups are running which failover policies, select “Groups by Failover Policies.”

5.5.17.2. Displaying Resource Groups with the Cluster Manager CLI

Use the following command to view the parameters of a defined resource group:

cmgr> show resource_group A [in cluster B]

If you have specified a default cluster, you do not need to specify a cluster in this command and the CLI will use the default.

Use the following command to view all of the defined failover policies:

cmgr> show resource_groups [in clusterA]