Setting up HP SIM 5.x on an HP-UX Serviceguard Cluster Abstract.............................................................................................................................................. 2 Introduction......................................................................................................................................... 2 Getting started ....................................................................................................................................
Abstract This white paper is intended to assist IT professionals installing HP Systems Insight Manager 5.x (HP SIM) on HP Serviceguard Clusters for HP-UX. The following scenario is explained.
Getting started Target audience It is assumed that readers of this document have an excellent understanding of the following concepts and services: • HP-UX 11v1, HP-UX 11v2 • TCP/IP and Clustering concepts • HP Serviceguard • PostgreSQL Settings up the common shared volume Note: Each disk size is approximately 2GB with 586 physical elements size of 4MB. On the primary node (sgcluster1), create the shared volume as follow: 1. Enter mkdir /dev/vg01. 2. Enter mknod /dev/vg01/group c 64 0x010000. 3.
9. Enter vgchange –a n vg01. 10. Modify /etc/lvmrc and set AUTO_VG_ACTIVATE to 0 Setting up Serviceguard Set up Serviceguard on the primary node by executing the following commands. 1. Enter cd /etc/cmcluster. 2. Create the cluster configuration file: cmquerycl –v –C cmclconfig.ascii –n sgcluster1 –n sgcluster2 3. Edit the cmclconfig.ascii and make the following changes: CLUSTER_NAME sgcluster HEARTBEAT_INTERVAL 3000000 NODE_TIMEOUT 6000000 AUTO_START_TIMEOUT 800000000 4.
On the secondary node, cut and paste the whole line if it is not present. Original: hpsmdb:*:104:20::/home/hpsmdb:/sbin/sh Change to: hpsmdb:*:109:20::/home/hpsmdb:/sbin/sh 3. Change the user ownership of hpsmdb to reflect the new userID number. This can be done by executing the following command: find /var/opt/hpsmdb –user 104 –exec chown 109 {} \; Configure the product to run in the Serviceguard environment by following the steps below. 1. Run swverify HPSIM-HP-UX and note any errors.
23. Enter find mx | cpio –pdmuxv /hpsimsg/var/opt. 24. Enter find hpsmdb | cpio –pdmuxv /hpsimsg/var/opt. 25. Enter mv mx mx.sg. 26. Enter mv hpsmdb hpsmdb.sg. 27. Enter ln –s /hpsimsg/var/opt/mx /var/opt/mx. 28. Enter ln –s /hpsimsg/var/opt/hpsmdb /var/opt/hpsmdb. 29. Run swverify again on HPSIM-HP-UX. You should get the same results as for step #1. Note: If swverify fails, run the command swjob -a log nutmeg-0044 @ :/ . Ensure all the symbolic links are connected. 30. Enter cd /sbin/init.d. 31.
Note: Be sure all the symbolic links are connected by running the long list command from each /hpsimsg directory to verify that the links are present. You will note an arrow connecting to the original path. Step 52 creates the subdirectory hpsim in /etc/cmcluster. 52. Enter mkdir /etc/cmcluster/hpsim. Verify that HP SIM is running properly on the secondary node. 53. Enter vgchange –c n vg01. 54. Enter vgchange –a y vg01. 55. Enter mount /dev/vg01/hpsimsg /hpsimsg. 56.
5. Set the permission for the file so that only root has access to hahpsim.sh by using the command: chmod 700 hahpsim.sh 6. Copy the file to the secondary node. 7. Enter rcp hahpsim.sh sgnode2:/etc/cmcluster/hpsim/hahpsim.sh. 8. Create the package configuration file: cmmakepkg –v –p hpsim.conf 9. Edit the hpsim.conf file and make the following changes: PACKAGE_NAME hahpsim NODE_NAME sgcluster1 NODE_NAME sgcluster2 RUN_SCRIPT /etc/cmcluster/hpsim/hpsim.cntl HALT_SCRIPT /etc/cmcluster/hpsim/hpsim.
13. Verify the configuration file: cmcheckconf –v –P hpsim.conf 14. Compile the configuration file: cmapplyconf –v –P hpsim.conf Testing the failover Start the cluster with the application running on the primary node by typing the following command: cmruncl –v cmviewcl –v Launch a browser to interact with HP SIM: http://sgcluster:280 Test the failover to the secondary node by stopping the database: /sbin/init.d/hpsmdb.
Appendix A hahpsim.sh #! /sbin/sh # Copyright (c) 2006 Hewlett-Packard Development Company, L.P. # High Availability HP System Insight Manager (SIM) script to # start, stop, and monitor the hpsim product # Usage: hahpsim.sh # where action is start, stop, or monitor MONITOR_INTERVAL=5 case $1 in start) # start the database and then hpsim /sbin/init.d/hpsmdb.
ps -ef |grep -v grep | grep -q mxdtf if [[ $? -ne 0 ]] then # mxdtf is not running echo $(date) mxdtf is not running, exiting monitor exit 3 fi sleep $MONITOR_INTERVAL done ;; *) # display usage and exit echo " exit 1 ;; esac Usage: hahpsim.
Appendix B hpsim.conf # # # # # # # ********************************************************************* ****** HIGH AVAILABILITY PACKAGE CONFIGURATION FILE (template) ****** ********************************************************************* ******* Note: This file MUST be edited before it can be used. ******* * For complete details about package parameters and how to set them, * * consult the Serviceguard Extension for RAC manuals.
PACKAGE_TYPE # # # # # # # # # # FAILOVER Enter the failover policy for this package. This policy will be used to select an adoptive node whenever the package needs to be started. The default policy unless otherwise specified is CONFIGURED_NODE. This policy will select nodes in priority order from the list of NODE_NAME entries specified below. The alternative policy is MIN_PACKAGE_NODE.
# failure, this permits the cluster software to switch LANs locally # (transfer to a standby LAN card). Adjust as necessary. # # LOCAL_LAN_FAILOVER_ALLOWED replaces obsolete NET_SWITCHING_ENABLED. LOCAL_LAN_FAILOVER_ALLOWED YES # Enter the value for NODE_FAIL_FAST_ENABLED. # Possible values are YES and NO. # The default for NODE_FAIL_FAST_ENABLED is NO. If set to YES, # in the event of a failure, the cluster software will halt the node # on which the package is running.
# Enter the names of the dependency condition for this package. # Dependencies are used to describe the relationship between packages # To define a dependency, all three attributes are required. # # DEPENDENCY_NAME must have a unique identifier for the dependency. # # DEPENDENCY_CONDITION # This is an expression describing what must be true for # the dependency to be satisfied. # # The syntax is: = UP , where # is the name of a multi-node or system multi-node package.
# SERVICE_HALT_TIMEOUT is not specified, a zero timeout will be # assumed, meaning the cluster software will not wait at all # before sending the SIGKILL signal to halt the service. # # Example: SERVICE_NAME DB_SERVICE # SERVICE_FAIL_FAST_ENABLED NO # SERVICE_HALT_TIMEOUT 300 # # To configure a service, uncomment the following lines and # fill in the values for all of the keywords.
# RESOURCE_UP_VALUE = "On Course" "On Course" # # If the type is numeric, then it can specify a threshold, or a range to # define a resource up condition. If it is a threshold, then any operator # may be used. If a range is to be specified, then only > or >= may be used # for the first operator, and only < or <= may be used for the second operator. # For example, # Resource is up when its value is # -------------------------------# RESOURCE_UP_VALUE = 5 5 (threshold) # RESOURCE_UP_VALUE > 5.
# These policies do not effect root users. Access Policies here # should not conflict with policies defined in the cluster configuration file.
Appendix C hpsim.cntl # # # # # # # # @(#) A.11.17.00 Date: 09/23/05 $ ********************************************************************** * * * HIGH AVAILABILITY PACKAGE CONTROL SCRIPT (template) * * * * Note: This file MUST be edited before it can be used. * * * ********************************************************************** # # # # # # The environment variables PACKAGE, NODE, SG_PACKAGE, SG_NODE and SG_SCRIPT_LOG_FILE are set by Serviceguard at the time the control script is executed.
# # Uncomment the first line # (CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=readonly"), # and comment out the default, if you want disk groups activated in # the readonly mode. # # Uncomment the second line # (CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=sharedread"), # and comment out the default, if you want disk groups activated in the # shared read mode.
# For example, if this package uses your disk groups dg01 and dg02, enter: # VXVM_DG[0]=dg01 # VXVM_DG[1]=dg02 # # The cvm disk group activation method is defined above. # #VXVM_DG[0]="" # # NOTE: A package could have LVM volume groups, CVM disk groups and VxVM # disk groups. # # NOTE: When VxVM is initialized it will store the hostname of the # local node in its volboot file in a variable called 'hostid'.
# LV[0]=""; FS[0]=""; FS_MOUNT_OPT[0]=""; FS_UMOUNT_OPT[0]=""; FS_FSCK_OPT[0]="" # FS_TYPE[0]="" and fill in the name of your first logical volume, # filesystem, mount, umount and fsck options and filesystem type # for the file system. You must begin with LV[0], FS[0], # FS_MOUNT_OPT[0], FS_UMOUNT_OPT[0], FS_FSCK_OPT[0], FS_TYPE[0] # and increment the list in sequence. # # Note: The FS_TYPE parameter lets you specify the type of filesystem to be # mounted.
# and then mount the file system. It will attempt to kill user and # retry mount, for the number of times specified in FS_MOUNT_RETRY_COUNT. # If the mount still fails after this number of attempts, the script # will exit with 1. # NOTE: If the FS_MOUNT_RETRY_COUNT > 0, the script will execute # "fuser -ku" to freeup busy mount point. FS_MOUNT_RETRY_COUNT=0 # # Configuring the concurrent operations below can be used to improve the # performance for starting up or halting a package.
# proceeds with a warning message in the package control script logfile. CONCURRENT_MOUNT_AND_UMOUNT_OPERATIONS=1 # Example: If a package uses 50 JFS filesystems, pkg01aa through pkg01bx, # which are mounted on the 50 logical volumes lvol1..
# SERVICE NAMES AND COMMANDS. # Specify the service name, command, and restart parameters which are # used by this package. Uncomment SERVICE_NAME[0]="", SERVICE_CMD[0]="", # SERVICE_RESTART[0]="" and fill in the name of the first service, command, # and restart parameters. You must begin with SERVICE_NAME[0], SERVICE_CMD[0], # and SERVICE_RESTART[0] and increment the list in sequence. # # For example: # SERVICE_NAME[0]=pkg1a # SERVICE_CMD[0]="/usr/bin/X11/xclock -display 192.10.25.
function customer_defined_run_cmds { # ADD customer defined run commands. # : # do nothing instruction, because a function must contain some command. /etc/cmcluster/hpsim/hahpsim.sh start test_return 51 } # This function is a place holder for customer define functions. # You should define all actions you want to happen here, after the service is # halted. function customer_defined_halt_cmds { # ADD customer defined halt commands. # : # do nothing instruction, because a function must contain some command.
For more information Refer to the following for more information regarding the topics referenced in this paper. HP Systems Insight Manager 5.x Overview and features http://h18013.www1.hp.com/products/servers/management/hpsim/index.html HP Systems Insight Manager quick specs http://h18013.www1.hp.com/products/servers/management/hpsim/quickspecs.html HP SIM Command Line Interface Guide http://h10018.www1.hp.com/wwsolutions/misc/hpsim-helpfiles/cliguide5.