Service Guard

Fundas:

The three central components of Serviceguard are
Package Manager
Cluster Manager
Network Manager

A manual startup forms a cluster out of all the nodes in the cluster configuration. Manual startup is normally done the first time you bring up the cluster, after cluster-wide maintenance or upgrade, or after reconfiguration.

The system administrator starts the cluster in Serviceguard Manager or with the cmruncl command issued from one node. The cmruncl command can only be used when the cluster is not running, that is, when none of the nodes is running the cmcld daemon.

Automatic cluster startup will take place if the flag AUTOSTART_CMCLD is set to 1 in the /etc/rc.config.d/cmcluster file. When any node reboots with this parameter set to 1, it will rejoin an existing cluster, or if none exists it will attempt to form a new cluster.

Service Guard Daemons:


  • /usr/lbin/cmclconfd - SG Configuration Daemon
  • /usr/lbin/cmcld - SG Cluster Daemon
  • /usr/lbin/cmlogd - SG Syslog Daemon
  • /usr/lbin/cmlvmd - SG LVM Daemon
  • /usr/lbin/cmsnmpd - SG Cluster SNMP subagent
  • /usr/lbin/cmnetd - SG Network Manager Daemon
  • /usr/lbin/qs - SG Quarum Server daemon
  • /usr/lbin/cmlockd - SG lock LUN Daemon

cmclconfd: This daemon is used by the Serviceguard commands to gather information from all the nodes within the cluster. It gathers configuration information such as information on networks and volume groups. It also distributes the cluster binary configuration file to all nodes in the cluster. This daemon is started by inetd.

cmcld: Two of the central components of SG - Package Manager and Cluster Manager - run as parts of cmcld daemon. This daemon determines cluster membership by sending heartbeat messages to cmcld daemons on other nodes in the SG Cluster.

cmnetd: This daemon monitors the health of the cluster networks, and performs local LAN failover. It also handles the addition and deletion of relocatable package IP(s).

Package Manager

Packages are the means by which Serviceguard starts and halts configured applications. A package is a collection of services, disk volumes and IP addresses.

The package manager residing on the cluster coordinator is known as package coordinator.

The package coordinator does the following

  • Decides when and where to run, halt, or move packages.

The package manager on all nodes does the following:

  • Executes the control scripts that run and halt packages and their services.
  • Reacts to changes in the status of monitored resources

Package Types:
There are three different types of packages.
01. Failover package (Most common type)
02. System multi-node package (Runs on all nodes)
03. Multi-node package (run on all or some of the nodes)


Serviceguard uses a special file, /etc/cmcluster.conf, to define the locations for configuration and log files within the HP-UX filesystem. The following locations are defined in the file:

################## cmcluster.conf ###############
# Highly Available Cluster file locations
# This file must not be edited
#################################################
SGCONF=/etc/cmcluster
SGSBIN=/usr/sbin
SGLBIN=/usr/lbin
SGLIB=/usr/lib
SGRUN=/var/adm/cmcluster
SGAUTOSTART=/etc/rc.config.d/cmcluster
SGFFLOC=/opt/cmcluster/cmff
CMSNMPD_LOG_FILE=/var/adm/SGsnmpsuba.log }

Disabling Service guard:


To disable service guard on a system, comment out the following two lines from /etc/inetd.conf file and force the inetd daemon to re-read the file using inetd -c command.

 hacl-cfg    dgram   udp    wait    root  /usr/lbin/cmclconfd cmclconfd -p
 hacl-cfg    stream  tcp    nowait  root  /usr/lbin/cmclconfd cmclconfd -c

To disable the package switching to node2

 # cmmodpkg -n node2 -d pkg1

To enable package switching to node 2

 # cmmodpkg -n node2 -e pkg1

To view the cluster config and status

 # cmciewcl -v

To stop monitoring pakage pkg1, create a file MAINT in /etc/cmcluster/pkg1/MAINT

 # Touch /etc/cmcluster/pkg1/MAINT

To restart the packge again

 # rm /etc/cmcluster/pkg1/MAINT

To activate a VG which is under Service Guard control, and when the cluster is not running

  #vgchange -c n vgname
  #vgchange -a y vgname

and when you are done you just need to deactivate your VG with

  #vgchange -a n vgname 

Quorum Server

If equal-sized groups of nodes become separated from each other, the Quorum Server allows one group to achieve quorum and form the cluster, while the other group is denied quorum and cannot start a cluster

The Quorum Server uses TCP/IP, and listens to connection requests from the Serviceguard nodes on port # 1238. The server maintains a special area in memory for each cluster; when a node obtains the cluster lock, this area is marked so that other nodes will recognize the lock as “taken.”

Configuring the Quorum server

01. Install the Quorum server using swinstall command

02. Add the following line in /etc/inittab file

    qs:345:respawn:/usr/lbin/qs >> /var/adm/qs/qs.log 2>&1

03. Start the Quorum Server as follows:

    # init q

04. Verify the Quorum Server is running by checking the qs.log file

    # vi /var/adm/qs/qs.log

05. Creating and Updating the Authorization File.

    # cat /etc/cmcluster/qs_authfile 
    test1 
    test2