Each 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.
# clresourcegroup set|create -p RG_affinities=neg-affinity-list source-rg
Specifies the resource group that is the source of the weak negative affinity. This resource group is the resource group on which you are declaring a weak negative affinity for other resource groups.
Specifies a comma-separated list of weak negative affinities between the source resource group and the resource groups that are the target of the weak negative affinity. The target resource groups are the resource groups for which you are declaring a weak negative affinity.
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 61 Distributing a Set of Resource Groups Evenly Among Cluster Nodes
This 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.
# clresourcegroup set -p RG_affinities=-rg2,-rg3,-rg4 rg1 # clresourcegroup set -p RG_affinities=-rg1,-rg3,-rg4 rg2 # clresourcegroup set -p RG_affinities=-rg1,-rg2,-rg4 rg3 # clresourcegroup set -p RG_affinities=-rg1,-rg2,-rg3 rg4