Sun Cluster Data Services Planning and Administration Guide for Solaris OS

Switching the Current Primary of a Resource Group

Use the following procedure to switch over a resource group from its current primary to another node that will become the new primary.

See the scrgadm(1M) and scswitch(1M) man pages for additional information.


Note –

Perform this procedure from any cluster node.


How to Switch the Current Primary of a Resource Group

To complete this procedure, you must supply the following information.

  1. Become superuser on a cluster member.

  2. Switch the primary to a potential primary.


    # scswitch -z -g resource-group -h nodelist
    
    -z

    Switches the specified resource group online.

    -g resource-group

    Specifies the name of the resource group to switch.

    -h nodelist

    Specifies a comma-separated list of the names of the nodes on which the resource group is to be brought online or is to remain online. The list may contain one node name or more than one node name. This resource group is then switched offline on all of the other nodes.


    Note –

    If any resource group that you are switching declares a strong affinity for other resource groups, the attempt to switch might fail or be delegated. For more information, see Distributing Online Resource Groups Among Cluster Nodes.


  3. Verify that the resource group has been switched to the new primary.

    Run the following command, and check the output for the state of the resource group that has been switched over.


    # scstat -g
    

Example – Switching the Resource Group to a New Primary

This example shows how to switch a resource group (resource-group-1) from its current primary (phys-schost-1) to the potential primary (phys-schost-2). First, verify that the resource group is online on phys-schost-1. Next, perform the switch. Finally, verify that the group is switched to be online on phys-schost-2.


phys-schost-1# scstat -g
...
Resource Group Name:          resource-group-1
  Status                                           
    Node Name:                phys-schost-1
    Status:                   Online

    Node Name:                phys-schost-2
    Status:                   Offline
...
phys-schost-1# scswitch -z -g resource-group-1 -h phys-schost-2
phys-schost-1# scstat -g
...
Resource Group Name:          resource-group-1
  Status                                           
    Node Name:                phys-schost-2
    Status:                   Online

    Node Name:                phys-schost-1
    Status:                   Offline
...