sun.com | docs.sun.com | How To Buy | My Sun | Worldwide Sites |  |

| Previous Contents Next
2. ## Managing Switchovers and Failovers You can trigger a switchover to swap the master and vice-master roles of the master-eligible nodes. A switchover is useful when you plan to take the master node down for maintenance. To trigger a switchover, see To Trigger a Switchover. However, if there is a problem on the master node, the master role fails over automatically to the vice-master node. In this case, the master and vice-master roles are also swapped, but because the cause is an unplanned problem, the swap is called a failover. To cause a failover, see To Reboot the Master Node Causing a Failover. ### To Trigger a Switchover Log in to a peer node as superuser. Identify the master node.
       # /opt/SUNWcgha/sbin/nhcmmstat -c all
4. The `nhcmmstat` command prints information on each peer node to the console window. Log in to the master node as superuser. Trigger a switchover.
       # /opt/SUNWcgha/sbin/nhcmmstat -c so
5. If there is a vice-master node qualified to become master in the cluster, this node is elected master. The old master node becomes the vice-master node. If there is no potential master, `nhcmmstat` does not perform a switchover. After the switchover is complete, verify that the roles of the master and vice-master nodes have been switched.
       # /opt/SUNWcgha/sbin/nhcmmstat -c vice
6. If the switchover is successful, the current node is the vice master. This command also verifies that the current node is synchronized with the new master node. Verify the cluster configuration.
       # /opt/SUNWcgha/sbin/nhadm check
2. For more information on `nhcmmstat`, see the `nhcmmstat`(1M) man page. ### To Reboot the Master Node Causing a Failover If you reboot the master node, you trigger a failover. Log in to a peer node as superuser. Run the `nhcmmstat` command to identify the master node.
       # /opt/SUNWcgha/sbin/nhcmmstat -c all
4. Log in to the master node as superuser. Shut down the master node.
       # init 5
6. The vice-master node becomes the master. Because one of the two master-eligible nodes in the cluster is shut down, you lose the redundancy of the cluster. To recover redundancy, restart the stopped node. Log in to a peer node as superuser. Verify that the vice-master node became the master node when the old master node was shut down.
       # /opt/SUNWcgha/sbin/nhcmmstat -c master
       Executed Command: master
       ------------------------------
       node_id     = 20   [This is the current node]
       domain_id   = 250
       name        = MEN-C250-N20
       role        = MASTER
       qualified   = YES
       synchro.    = NEEDED !!!
       frozen      = NO
       excluded    = NO
       eligible    = YES
       incarn.     = 1038481013 (28/11/2002 - 11:56:53)
       swload_id   = 1
       CGTP @      = 10.250.3.20
       ------------------------------
7. The output shows that the vice-master node is now the master node. In addition, the new master node displays a requirement for synchronizing its disk with the disk of the old master node. Restart the old master node, which you shut down in Step 4.
       lom> poweron
8. This node now automatically becomes the vice-master node. Run the `nhcmmstat` command to verify that the current node is the vice-master node.
       # /opt/SUNWcgha/sbin/nhcmmstat -c all
       Executed Command: all
       ------------------------------
       node_id     = 30
       domain_id   = 250
       name        = node30
       role        = IN
       qualified   = YES
       synchro.    = READY
       frozen      = NO
       excluded    = NO
       eligible    = NO
       incarn.     = 1038422116 (27/11/2002 - 19:35:16)
       swload_id   = 1
       CGTP @      = 10.250.3.30
       ------------------------------
       ------------------------------
       node_id     = 20
       domain_id   = 250
       name        = MEN-C250-N20
       role        = MASTER
       qualified   = YES
       synchro.    = READY
       frozen      = NO
       excluded    = NO
       eligible    = YES
       incarn.     = 1038481013 (28/11/2002 - 11:56:53)
       swload_id   = 1
       CGTP @      = 10.250.3.20
       ------------------------------
       ------------------------------
       node_id     = 10   [This is the current node]
       domain_id   = 250
       name        = MEN-C250-N10
       role        = VICE-MASTER
       qualified   = YES
       synchro.    = READY
       frozen      = NO
       excluded    = NO
       eligible    = YES
       incarn.     = 1038481383 (28/11/2002 - 12:03:03)
       swload_id   = 1
       CGTP @      = 10.250.3.10
       ------------------------------
10. Log in to the new vice-master node as superuser. Verify that the node has started correctly.
        # /opt/SUNWcgha/sbin/nhadm check
For more information on the tests run by `nhadm check`, see the `nhadm`(1M) man page.
Previous Contents Next

Copyright 1994-2004 Sun Microsystems