Nonstop Database, HiRDB Version 9 System Operation Guide
We recommend that you read this subsection if you are using Sun Cluster as your cluster software.
For details about how to set up a Sun Cluster environment, see the Sun Cluster documentation.
This subsection explains how to start Sun Cluster, based on the system configuration described below.
Sun Cluster does not have a command for starting the entire cluster. You start the cluster at the first node, and then you add other nodes to that cluster. First, use scadmin(1M) to start the cluster of the master node.
[sc-node0] # scadmin startcluster sc-node0 sun_cluster Node specified is sc-node0 Cluster specified is sun_cluster =========================== WARNING ================================= = Creating a new cluster = ===================================================================== You are attempting to start up the cluster node 'sc-node0' as the only node in a new cluster. It is important that no other cluster nodes be active at this time. If this node hears from other cluster nodes, this node will abort. Other nodes may only join after this command has completed successfully. Data corruption may occur if more than one cluster is active. Do you want to continue [y,n,?] y |
Next, confirm that the master node has started, and then add other nodes to the cluster.
[sc-node1] # scadmin startnode |
When all nodes have started, use hastat(1M) to check the status of the entire cluster.
[sc-node1] # hastat Getting Information from all the nodes ...... HIGH AVAILABILITY CONFIGURATION AND STATUS ------------------------------------------- LIST OF NODES CONFIGURED IN <sun_cluster> CLUSTER sc-node0 sc-node1 CURRENT MEMBERS OF THE CLUSTER sc-node0 is a cluster member <-- Node has started. sc-node1 not a cluster member <-- Node has not started. |
If startup fails, use /var/adm/messages and /var/opt/SUNWcluster/scadmin.log to check for errors.
Create a disk group to be used as a shared disk. Area setup and formatting for the created disk group are specified when the HiRDB environment for the master node is set. The explanation in this subsection uses Sun Enterprise Volume Manager.
The network interface to be used by the logical host must be set to PNM. If a dual network interface is used, it must be set in a NAFO group.
After the shared disk and network have been set up, create a logical host. The configuration below is assumed here.
If you are not using a DNS server, register the host name of the logical host in the hosts file. This must be set up in both nodes in the cluster.
172.16.170.100 sc-lnode0 # Sun Cluster logical host 0 |
After confirming that the cluster has been started, create a logical host. You create the host on one node in the cluster.
[sc-node0] # hastat <-- Cluster status check [sc-node0] # scconf sun_cluster -L sc-lnode0 \ <-- Logical host name > -n sc-node0, sc-node1 \ <-- Node > -g dg0 \ <-- Disk group > -i qfe1, qfe1, sc-lnode0 \ <-- Network > -m <-- Automatic changeback disabled /etc/opt/SUNWcluster/conf/sun_cluster.cdb Checking node status... [sc-node0] # |
Use scconf -F to create a management file system for storing the configuration information of the logical host. A management file system must be created for all nodes that use the logical host.
[sc-node0] # scconf sun_cluster -F sc-lnode0 /etc/opt/SUNWcluster/conf/sun_cluster.cdb Checking node status... [sc-node0] # |
When scconf -F terminates normally, the logical host starts in the master node (the first node specified in -n), and the shared disk and logical IP addresses are allocated.
Use vxprint to confirm that a management file system has been created. The logical volume indicated by disk-group-name-stat is the management file system.
[sc-node0] # vxprint Disk group: dg0 Y NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg dg0 dg0 - - - - - - dm dg001 c2t0d0s2 - 17678493 - - - - v dg0-stat fsgen ENABLED 4096 - ACTIVE - - pl dg0-stat-01 dg0-stat ENABLED 7182 - ACTIVE - - sd dg001-01 dg0-stat-01 ENABLED 7182 0 - - - |
The steps taken so far enable the logical host to start. Start the logical host at each node and check the operation of all of the logical hosts.
[sc-node0] # haswitch -m sc-lnode0 <-- Stop the logical host. [sc-node0] # haswitch sc-node0 sc-lnode0 <-- Start the logical host. [sc-node0] # netstat -in <-- Verify the logical IP address. Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue Qfe1:1 1500 172.16.170.0 172.16.170.100 0 0 0 0 0 0 |
Check these items at all nodes.
[sc-node1] # haswitch sc-node1 sc-lnode0 <-- Start the logical host. [sc-node1] # netstat -in <-- Verify the logical IP address. |
If the shared disk and logical IP addresses have been assigned correctly, the logical host has been configured normally.
This subsection provides an overview of Sun Cluster's service control, and explains how to register HiRDB as a data service in the Sun Cluster environment using a Sun Cluster control script.
Use HA-API to register HiRDB as a data service in the Sun Cluster environment. Available APIs include data service registration (hareg) and cluster status check (haget). For details, see the Sun Cluster documentation.
A method refers to a call-out to a data service that occurs in each step during reconfiguration. The following methods are available:
For the HiRDB data service, register the control scripts that will be called when the Start (START_NET) and Stop (STOP_NET) methods occur.
To set up the HiRDB environment as a data service in the Sun Cluster environment, you must perform execution control using Sun Cluster HA-API. This subsection provides and explains an example of creating Sun Cluster control scripts to control the calling of methods from Sun Cluster. The following names are used for the Sun Cluster control scripts to be created:
Script to be executed by START_NET
#!/bin/sh ## ********************************************************************* ## HiRDB START_NET Control Script ( for Sun Cluster) ## ********************************************************************* PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/SUNWcluster/bin:/HiRDB_S1/bin export PATH PDDIR=/HiRDB_S1 PDCONFPATH=/HiRDB_S1/conf LD_LIBRARY_PATH=/HiRDB_S1/lib export PDDIR PDCONFPATH LD_LIBRARY_PATH if [ "$1" != "sc-lnode0" ] then exit 0 fi $PDDIR/bin/pdstart |
Script to be executed by STOP_NET
#!/bin/sh ## ********************************************************************* ## HiRDB STOP_NET Control Script ( for Sun Cluster) ## ********************************************************************* PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/SUNWcluster/bin:/HiRDB_S1/bin export PATH PDDIR=/HiRDB_S1 PDCONFPATH=/HiRDB_S1/conf LD_LIBRARY_PATH=/HiRDB_S1/lib export PDDIR PDCONFPATH LD_LIBRARY_PATH if [ "$2" != "sc-lnode0" ] then exit 0 fi MASTER_HOST=`haget -f master -h sc-lnode0` if [ $MASTER_HOST != `hostname` ] then exit 0 fi $PDDIR/bin/pdstop -f -q # |
Use Sun Cluster's hareg command to register the HiRDB data service hirdb00 into the logical host.
hareg -r hirdb00 -b "/HiRDB_S1/conf" -m START_NET="hirdb00-start_net.sh" -t START_NET=1800 -m STOP_NET="hirdb00-stop_net.sh" -t STOP_NET=300 -h sc-lnode0 -a 1 |
All Rights Reserved. Copyright (C) 2011, 2015, Hitachi, Ltd.