Configuring a Cluster Resource Group

Some cluster resources are dependent on other components or resources, and require that each component or resource are started in a specific order and run together on the same server. To simplify this configuration we support the concept of groups.

Groups have the following properties:

Starting and Stopping Resources

Resources are started in the order they appear in and stopped in the reverse order which they appear in.

Dependency

If a resource in the group cannot run anywhere, then none of the resources located after that resource in the group is allowed to run.

Group Contents

Groups may only contain a collection of primitive cluster resources. To refer to the child of a group resource, use the child’s ID instead of the group’s.

Constraints

Although it is possible to reference the group’s children in constraints, it is usually preferable to use the group’s name instead.

Stickiness

Stickiness is additive in groups. Every active member of the group will contribute its stickiness value to the group’s total. So if the default resource-stickiness is 100 and a group has seven members, five of which are active, then the group as a whole will prefer its current location with a score of 500.

Resource Monitoring

To enable resource monitoring for a group, you must configure monitoring separately for each resource in the group that you want monitored.

[Note]Empty Groups

Groups must contain at least one resource, otherwise the configuration is not valid.

Procedure 4.9. Adding a Resource Group

  1. Start the Linux HA Management Client and log in to the cluster as described in Section 4.1, “Linux HA Management Client”.

  2. In the left pane, select Resources and click Add+Group.

  3. Enter a unique ID for the group.

  4. Below Options, set the Initial state of resource and click Forward.

  5. In the next step, you can add primitives as sub-resources for the group. These are created similar as described in Adding Primitive Resources.

  6. If all parameters are set according to your wishes, click Apply to finish the configuration of the primitive.

  7. In the next window, you can continue adding sub-resources for the group by choosing Primitive again and clicking OK.

    When you do not want to add more primitives to the group, click Cancel instead. The next window shows a summary of the parameters that you have already defined for that group. The Meta Attributes and Primitives of the group are listed. The position of the resources in the Primitive tab represents the order in which the resources are started in the cluster.

  8. As the order of resources in a group is important, use the Up and Down buttons to sort or resort the Primitives in the group.

  9. If all parameters are set according to your wishes, click OK to finish the configuration of that group. The configuration dialog is closed and the main window shows the newly created or modified group.

Figure 4.4. Linux HA Management Client - Groups

Linux HA Management Client - Groups

Example 4.1. Resource Group for a Web Server

An example for a resource group is a Web server that requires an IP address and a file system. In this case each component is a separate cluster resource that is combined into a cluster resource group. The resource group would then run on a server or servers, and in case of a software or hardware malfunction, fail over to another server in the cluster the same as an individual cluster resource.


Figure 4.5. Group Resource

Group Resource

In Adding a Resource Group, you learned how to create a resource group. Let us assume you already have created a resource group like explained above. Adding Resources to an Existing Group shows you how to modify the group to match Example 4.1, “Resource Group for a Web Server”.

Procedure 4.10. Adding Resources to an Existing Group

  1. Start the Linux HA Management Client and log in to the cluster as described in Section 4.1, “Linux HA Management Client”.

  2. In the left pane, switch to the Resources view and in the right pane, select the group to modify and click Edit. The next window shows the basic group parameters and the meta attributes and primitives already defined for that resource.

  3. Click the Primitives tab and click Add.

  4. In the next dialog, set the following parameters to add an IP address as sub-resource of the group:

    1. Enter a unique ID, for example, my_ipaddress.

    2. From the Class list, select ocf as resource agent class.

    3. As Provider of your OCF resource agent, select heartbeat.

    4. From the Type list, select IPaddr as resource agent.

    5. Click Forward.

    6. In the Instance Attribute tab, select the IP entry and click Edit (or double-click the IP entry).

    7. As Value, enter the desired IP address, for example, 192.168.1.1.

    8. Click OK and Apply. The group configuration dialog shows the newly added primitive.

  5. Add the next sub-resources (file system and Web server) by clicking Add again.

  6. Set the respective parameters for each of the sub-resources similar to steps Step 4.a to Step 4.h, until you have configured all sub-resources for the group.

    As we configured the sub-resources already in the order in that they need to be started in the cluster, the order on the Primitives tab is already correct.

  7. In case you need to change the resource order for a group, use the Up and Down buttons to resort the resources on the Primitive tab.

  8. To remove a resource from the group, select the resource on the Primitives tab and click Remove.

  9. Click OK to finish the configuration of that group. The configuration dialog is closed and the main window shows the modified group.