• No results found

Note: Sub-resources for Multi-state Resources

7.6 Configuring Constraints

7.6.4 Using Resource Sets for Constraints

As an alternative format for defining constraints, you can use Resource Sets. They have the same ordering semantics as Groups.

PROCEDURE 7.17: USING A RESOURCE SET FOR CONSTRAINTS

1. To use a resource set within a location constraint:

a. Proceed as outlined in Procedure 7.14, “Adding a Location Constraint”, apart from Step 4: Instead of selecting a single resource, select multiple resources by pressing Ctrl or

Shift and mouse click. This creates a resource set within the location constraint.

b. To remove a resource from the location constraint, press Ctrl and click the resource again to deselect it.

2. To use a resource set within a colocation or order constraint:

a. Proceed as described in Procedure  7.15, “Adding a Colocation Constraint” or Procedure 7.16, “Adding an Order Constraint”, apart from the step where you define the resources for the constraint (Step 5.a or Step 6.a):

b. Add multiple resources.

173 For More Information SLE HA 12 SP1 c. To create a resource set, click the chain icon next to a resource to link it to the resource above. A resource set is visualized by a frame around the resources belonging to a set.

d. You can combine multiple resources in a resource set or create multiple resource sets.

FIGURE 7.13: HAWK2—TWO RESOURCE SETS IN A COLOCATION CONSTRAINT

e. To unlink a resource from the resource above, click the scissors icon next to the resource.

3. Confirm your changes to finish the constraint configuration.

7.6.5 For More Information

For more information on configuring constraints and detailed background information about the basic concepts of ordering and colocation, refer to the documentation available at http://

www.clusterlabs.org/doc/:

Pacemaker Explained, chapter Resource Constraints Colocation Explained

Ordering Explained

174 Specifying Resource Failover Nodes SLE HA 12 SP1

7.6.6 Specifying Resource Failover Nodes

A resource will be automatically restarted if it fails. If that cannot be achieved on the current node, or it fails N times on the current node, it will try to fail over to another node. You can define a number of failures for resources (a migration-threshold), after which they will migrate to a new node. If you have more than two nodes in your cluster, the node to which a particular resource fails over is chosen by the High Availability software.

You can specify a specific node to which a resource will fail over by proceeding as follows:

PROCEDURE 7.18: SPECIFYING A FAILOVER NODE

1. Log in to Hawk2:

https://HAWKSERVER:7630/

2. Configure a location constraint for the resource as described in Procedure 7.14, “Adding a Location Constraint”.

3. Add the migration-threshold meta attribute to the resource as described in Procedure 7.7: Modifying Parameters, Operations, or Meta Attributes for a Resource, Step 4 and enter a value for the migration-threshold. The value should be positive and less than INFINITY.

4. If you want to automatically expire the failcount for a resource, add the failure-timeout meta attribute to the resource as described in Procedure  6.5: Adding Primitive Resources, Step 7 and enter a Value for the failure-timeout.

175 Specifying Resource Failback Nodes (Resource Stickiness) SLE HA 12 SP1 5. If you want to specify additional failover nodes with preferences for a resource, create

additional location constraints.

The process flow regarding migration thresholds and failcounts is demonstrated in Example 5.6,

“Migration Threshold—Process Flow”.

Instead of letting the failcount for a resource expire automatically, you can also clean up failcounts for a resource manually at any time. Refer to Section 7.7.2, “Cleaning Up Resources” for details.

7.6.7 Specifying Resource Failback Nodes (Resource Stickiness)

A resource may fail back to its original node when that node is back online and in the cluster.

To prevent this or to specify a different node for the resource to fail back to, change the stickiness value of the resource. You can either specify the resource stickiness when creating it or afterwards.

For the implications of different resource stickiness values, refer to Section 5.4.5, “Failback Nodes”.

PROCEDURE 7.19: SPECIFYING RESOURCE STICKINESS

176 Managing Cluster Resources SLE HA 12 SP1 1. Log in to Hawk2:

https://HAWKSERVER:7630/

2. Add the resource-stickiness meta attribute to the resource as described in Procedure 7.7: Modifying Parameters, Operations, or Meta Attributes for a Resource, Step 4. 3. Specify a value between -INFINITY and INFINITY for resource-stickiness.

7.7 Managing Cluster Resources

In addition to configuring your cluster resources, Hawk allows you to manage existing resources from the Status screen. For a general overview of the screen refer to Section 7.7.5, “Monitoring a Cluster”.

7.7.1 Starting Resources

Before you start a cluster resource, make sure it is set up correctly. For example, if you want to use an Apache server as a cluster resource, set up the Apache server first. Complete the Apache configuration before starting the respective resource in your cluster.

177 Cleaning Up Resources SLE HA 12 SP1

Note: Do Not Touch Services Managed by the Cluster

When managing a resource via the High Availability Extension, the resource must not be started or stopped otherwise (outside of the cluster, for example manually or on boot or reboot). The High Availability Extension software is responsible for all service start or stop actions.

However, if you want to check if the service is configured properly, start it manually, but make sure that it is stopped again before High Availability takes over.

For interventions in resources that are currently managed by the cluster, set the resource to maintenance mode first.

When creating a resource with Hawk, you can set its initial state with the target-role meta attribute. If you set its value to stopped, the resource does not start automatically after being created.

PROCEDURE 7.20: STARTING A NEW RESOURCE

1. Log in to Hawk2:

https://HAWKSERVER:7630/

2. In the left navigation bar, select Status. The list of Resources also shows the Status.

3. Select the resource to start and in its Operations column click the Start icon. To continue, confirm the message that appears.

As soon as the resource has started, Hawk changes the resource's Status to green and shows on which node it is running.

7.7.2 Cleaning Up Resources

A resource will be automatically restarted if it fails, but each failure increases the resource's failcount.

If a migration-threshold has been set for the resource, the node will no longer run the resource when the number of failures reaches the migration threshold.

A resource's failcount can either be reset automatically (by setting a failure-timeout option for the resource) or it can be reset manually as described below.

178 Removing Cluster Resources SLE HA 12 SP1 PROCEDURE 7.21: CLEANING UP A RESOURCE

1. Log in to Hawk2:

https://HAWKSERVER:7630/

2. In the left navigation bar, select Status. The list of Resources also shows the Status.

3. Go to the resource to clean up. In the Operations column click the arrow down button and select Cleanup. To continue, confirm the message that appears.

This executes the command crm resource cleanup and cleans up the resource on all nodes.

7.7.3 Removing Cluster Resources

If you need to remove a resource from the cluster, follow the procedure below to avoid configuration errors:

PROCEDURE 7.22: REMOVING A CLUSTER RESOURCE

1. Clean up the resource on all nodes as described in Procedure 7.21, “Cleaning Up A Resource”. 2. Stop the resource:

a. In the left navigation bar, select Status. The list of Resources also shows the Status.

b. In the Operations column click the Stop button next to the resource.

c. To continue, confirm the message that appears.

The Status column will reflect the change as soon as the resource is stopped.

3. Delete the resource:

a. In the left navigation bar, select Edit.

b. In the list of Resources, go to the respective resource. From the Operations column click the Delete icon next to the resource.

c. To continue, confirm the message that appears.

179 Migrating Cluster Resources SLE HA 12 SP1

7.7.4 Migrating Cluster Resources

As mentioned in Section  7.6.6, “Specifying Resource Failover Nodes”, the cluster will fail over (migrate) resources automatically in case of software or hardware failures—according to certain parameters you can define (for example, migration threshold or resource stickiness). You can also manually migrate a resource to another node in the cluster. Or you decide to move the resource away from the current node and let the cluster decide where to put it.

PROCEDURE 7.23: MANUALLY MIGRATING A RESOURCE

1. Log in to Hawk2:

https://HAWKSERVER:7630/

2. In the left navigation bar, select Status. The list of Resources also shows the Status.

3. In the list of Resources, select the respective resource.

4. In the Operations column click the arrow down button and select Migrate. To continue, confirm the message that appears.

To allow a resource to move back again, proceed as follows:

PROCEDURE 7.24: UNMIGRATING A RESOURCE

1. Log in to Hawk2:

https://HAWKSERVER:7630/

2. In the left navigation bar, select Status. The list of Resources also shows the Status.

3. In the list of Resources, go to the respective resource.

4. In the Operations column click the arrow down button and select Unmigrate. To continue, confirm the message that appears.

This uses the crm_resource  -U command. The resource can move back to its original location or it may stay where it is (depending on resource stickiness).

For more information, see Pacemaker Explained, available from http://www.clusterlabs.org/doc/. Refer to section Resource Migration.

180 Monitoring a Cluster SLE HA 12 SP1