Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (1474 KB)
Distributing Online Resource Groups Among Cluster NodesFor maximum availability or optimum performance, some combinations of services require a specific distribution of online resource groups among cluster nodes and zones. Distributing online resource groups involves creating affinities between resource groups for the following purposes:
This section provides the following examples of how to use resource group affinities to distribute online resource groups among cluster nodes and zones:
Resource Group AffinitiesAn affinity between resource groups restricts on which nodes or zones the resource groups may be brought online simultaneously. In each affinity, a source resource group declares an affinity for a target resource group or several target resource groups. To create an affinity between resource groups, set the RG_affinities resource group property of the source as follows:
Weak affinities take precedence over Nodelist preference ordering. The current state of other resource groups might prevent a strong affinity from being satisfied on any node or zone. In this situation, the resource group that is the source of the affinity remains offline. If other resource groups' states change to enable the strong affinities to be satisfied, the resource group that is the source of the affinity comes back online. Note – Use caution when declaring a strong affinity on a source resource group for more than one target resource group. If all declared strong affinities cannot be satisfied, the source resource group remains offline. Enforcing Collocation of a Resource Group With Another Resource GroupA service that is represented by one resource group might depend so strongly on a service in a second resource group that both services must run on the same node or zone. For example, an application that is comprised of multiple interdependent service daemons might require that all daemons run on the same node or zone. In this situation, force the resource group of the dependent service to be collocated with the resource group of the other service. To enforce collocation of a resource group with another resource group, declare on the resource group a strong positive affinity for the other resource group.
A resource group follows the resource group for which it has a strong positive affinity. If the target resource group is relocated to a different node, the source resource group automatically switches to the same node as the target. However, a resource group that declares a strong positive affinity is prevented from failing over to a node or zone on which the target of the affinity is not already running. Note – Only failovers that are initiated by a resource monitor are prevented. If a node or zone on which the source resource group and target resource group are running fails, both resource groups fail over to the same surviving node or zone. For example, a resource group rg1 declares a strong positive affinity for resource group rg2. If rg2 fails over to another node or zone, rg1 also fails over to that node or zone. This failover occurs even if all the resources in rg1 are operational. However, if a resource in rg1 attempts to fail over rg1 to a node or zone where rg2 is not running, this attempt is blocked. The source of a strong positive affinity might be offline on all nodes when you bring online the target of the strong positive affinity. In this situation, the source of the strong positive affinity is automatically brought online on the same node as the target. For example, a resource group rg1 declares a strong positive affinity for resource group rg2. Both resource groups are initially offline on all nodes. If an administrator brings online rg2 on a node, rg1 is automatically brought online on the same node. You can use the clresourcegroup suspend command to prevent a resource group from being brought online automatically due to strong affinities or cluster reconfiguration. If you require a resource group that declares a strong positive affinity to be allowed to fail over, you must delegate the failover. For more information, see Delegating the Failover or Switchover of a Resource Group. Example 2–40 Enforcing Collocation of a Resource Group With Another Resource GroupThis example shows the command for modifying resource group rg1 to declare a strong positive affinity for resource group rg2. As a result of this affinity relationship, rg1 is brought online only on nodes or zones where rg2 is running. This example assumes that both resource groups exist.
Specifying a Preferred Collocation of a Resource Group With Another Resource GroupA service that is represented by one resource group might use a service in a second resource group. As a result, these services run most efficiently if they run on the same node or zone. For example, an application that uses a database runs most efficiently if the application and the database run on the same node or zone. However, the services can run on different nodes or zones because the reduction in efficiency is less disruptive than additional failovers of resource groups. In this situation, specify that both resource groups should be collocated if possible. To specify preferred collocation of a resource group with another resource group, declare on the resource group a weak positive affinity for the other resource group.
By declaring a weak positive affinity on one resource group for another resource group, you increase the probability of both resource groups running on the same node or zone. The source of a weak positive affinity is first brought online on a node or zone where the target of the weak positive affinity is already running. However, the source of a weak positive affinity does not fail over if a resource monitor causes the target of the affinity to fail over. Similarly, the source of a weak positive affinity does not fail over if the target of the affinity is switched over. In both situations, the source remains online on the node or zone where the source is already running. Note – If a node or zone on which the source resource group and target resource group are running fails, both resource groups are restarted on the same surviving node or zone. Example 2–41 Specifying a Preferred Collocation of a Resource Group With Another Resource GroupThis example shows the command for modifying resource group rg1 to declare a weak positive affinity for resource group rg2. As a result of this affinity relationship, rg1 and rg2 are first brought online on the same node or zone. But if a resource in rg2 causes rg2 to fail over, rg1 remains online on the node or zone where the resource groups were first brought online. This example assumes that both resource groups exist.
Distributing a Set of Resource Groups Evenly Among Cluster NodesEach resource group in a set of resource groups might impose the same load on the cluster. In this situation, by distributing the resource groups evenly among cluster nodes, you can balance the load on the cluster. To distribute a set of resource groups evenly among cluster nodes, declare on each resource group a weak negative affinity for the other resource groups in the set.
By declaring a weak negative affinity on one resource group for other resource groups, you ensure that a resource group is always brought online on the most lightly loaded node in the cluster. The fewest other resource groups are running on that node. Therefore, the smallest number of weak negative affinities are violated. Example 2–42 Distributing a Set of Resource Groups Evenly Among Cluster NodesThis example shows the commands for modifying resource groups rg1, rg2, rg3, and rg4 to ensure that these resource groups are evenly distributed among the available nodes in the cluster. This example assumes that resource groups rg1, rg2, rg3, and rg4 exist.
Specifying That a Critical Service Has PrecedenceA cluster might be configured to run a combination of mission-critical services and noncritical services. For example, a database that supports a critical customer service might run in the same cluster as noncritical research tasks. To ensure that the noncritical services do not affect the performance of the critical service, specify that the critical service has precedence. By specifying that the critical service has precedence, you prevent noncritical services from running on the same node as the critical service. When all nodes are operational, the critical service runs on a different node from the noncritical services. However, a failure of the critical service might cause the service to fail over to a node where the noncritical services are running. In this situation, the noncritical services are taken offline immediately to ensure that the computing resources of the node are fully dedicated to the mission-critical service. To specify that a critical service has precedence, declare on the resource group of each noncritical service a strong negative affinity for the resource group that contains the critical service.
A resource group moves away from a resource group for which it has a strong negative affinity. The source of a strong negative affinity might be offline on all nodes when you take offline the target of the strong negative affinity. In this situation, the source of the strong negative affinity is automatically brought online. In general, the resource group is brought online on the most preferred node, based on the order of the nodes in the node list and the declared affinities. For example, a resource group rg1 declares a strong negative affinity for resource group rg2. Resource group rg1 is initially offline on all nodes, while resource group rg2 is online on a node. If an administrator takes offline rg2, rg1 is automatically brought online. You can use the clresourcegroup suspend command to prevent the source of a strong negative affinity from being brought online automatically due to strong affinities or cluster reconfiguration. Example 2–43 Specifying That a Critical Service Has PrecedenceThis example shows the commands for modifying the noncritical resource groups ncrg1 and ncrg2 to ensure that the critical resource group mcdbrg has precedence over these resource groups. This example assumes that resource groups mcdbrg, ncrg1, and ncrg2 exist.
Delegating the Failover or Switchover of a Resource GroupThe source resource group of a strong positive affinity cannot fail over or be switched over to a node where the target of the affinity is not running. If you require the source resource group of a strong positive affinity to be allowed to fail over or be switched over, you must delegate the failover to the target resource group. When the target of the affinity fails over, the source of the affinity is forced to fail over with the target. Note – You might need to switch over the source resource group of a strong positive affinity that is specified by the ++ operator. In this situation, switch over the target of the affinity and the source of the affinity at the same time. To delegate failover or switchover of a resource group to another resource group, declare on the resource group a strong positive affinity with failover delegation for the other resource group.
A strong positive affinity with failover delegation is not fully symmetric. The target can come online while the source remains offline. However, if the target is offline, the source cannot come online. If the target declares a strong positive affinity with failover delegation for a third resource group, failover or switchover is further delegated to the third resource group. The third resource group performs the failover or switchover, forcing the other resource groups to fail over or be switched over also. Example 2–44 Delegating the Failover or Switchover of a Resource GroupThis example shows the command for modifying resource group rg1 to declare a strong positive affinity with failover delegation for resource group rg2. As a result of this affinity relationship, rg1 delegates failover or switchover to rg2. This example assumes that both resource groups exist.
Combining Affinities Between Resource GroupsYou can create more complex behaviors by combining multiple affinities. For example, the state of an application might be recorded by a related replica server. The node selection requirements for this example are as follows:
You can satisfy these requirements by configuring resource groups for the application and the replica server as follows:
Example 2–45 Combining Affinities Between Resource GroupsThis example shows the commands for combining affinities between the following resource groups.
In this example, the resource groups declare affinities as follows:
This example assumes that both resource groups exist.
|
|||||||||||||||||||||||||||||||