付録U.10 サンプルファイル

<この項の構成>
(1) HP-UX版
(2) AIX版

(1) HP-UX版

付録U.6で生成したひな形を,Scheduler Server,Facilities Manager用に編集した例を示します。なお,下線部は編集した部分です。

(a) クラスタ定義ファイル

# **********************************************************************
# ********* HIGH AVAILABILITY CLUSTER CONFIGURATION FILE ***************
# ***** For complete details about cluster parameters and how to    ****
# ***** set them, consult the cmquerycl(1m) manpage or your manual. ****
# **********************************************************************

# Enter a name for this cluster.  This name will be used to identify the
# cluster when viewing or manipulating it.

CLUSTER_NAME               cluster2

# Cluster Lock Device Parameters.  This is the volume group that
# holds the cluster lock which is used to break a cluster formation
# tie.  This volume group should not be used by any other cluster
# as cluster lock device.

# Warning: No volume groups were found on all nodes.
# A cluster lock volume group is required for clusters of only two nodes.
FIRST_CLUSTER_LOCK_VG               /dev/vg03

# Definition of nodes in the cluster.
# Repeat node definitions as necessary for additional nodes.

NODE_NAME          node1
 NETWORK_INTERFACE lan0
   HEARTBEAT_IP            172.1.1.1

# Warning: No volume groups were found on all nodes.
# A cluster lock device is required for clusters of only two nodes.
 FIRST_CLUSTER_LOCK_PV             /dev/dsk/c3t0d0
# List of serial device file names
# For example:
# SERIAL_DEVICE_FILE        /dev/tty0p0

# Primary Network Interfaces on Bridged Net 1: lan0.
#   Warning: There are no standby network interfaces on bridged net 1.

NODE_NAME          node2
 NETWORK_INTERFACE lan0
   HEARTBEAT_IP            172.1.1.2

# Warning: No volume groups were found on all nodes.
# A cluster lock device is required for clusters of only two nodes.
 FIRST_CLUSTER_LOCK_PV             /dev/dsk/c1t2d0
# List of serial device file names
# For example:
# SERIAL_DEVICE_FILE        /dev/tty0p0

# Primary Network Interfaces on Bridged Net 1: lan0.
#   Warning: There are no standby network interfaces on bridged net 1.

# Cluster Timing Parmeters (microseconds).

HEARTBEAT_INTERVAL         1000000
NODE_TIMEOUT               2000000

# Configuration/Reconfiguration Timing Parameters (microseconds).

AUTO_START_TIMEOUT         600000000
NETWORK_POLLING_INTERVAL   2000000

# Package Configuration Parameters.
# Enter the maximum number of packages which will be configured in the cluster.
# You can not add packages beyond this limit.
# This parameter is required.
MAX_CONFIGURED_PACKAGES             2

# List of cluster aware Volume Groups. These volume groups will
# be used by clustered applications via the vgchange -a e command.
# For example:
# VOLUME_GROUP             /dev/vgdatabase.
VOLUME_GROUP               /dev/vg03

(b) パッケージ定義ファイル

# **********************************************************************
# ****** 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 MC/ServiceGuard or MC/LockManager manpages or manuals. *
# **********************************************************************

# Enter a name for this package.  This name will be used to identify the
# package when viewing or manipulating it.  It must be different from
# the other configured package names.

PACKAGE_NAME                        gmaxpkg

# Enter the names of the nodes configured for this package.  Repeat
# this line as necessary for additional adoptive nodes.
# Order IS relevant.  Put the second Adoptive Node AFTER the first
# one.
# Example : NODE_NAME  original_node  
#           NODE_NAME  adoptive_node  

NODE_NAME                  node1
NODE_NAME                  node2

# Enter the complete path for the run and halt scripts.  In most cases
# the run script and halt script specified here will be the same script,
# the package control script generated by the cmmakepkg command.  This
# control script handles the run(ning) and halt(ing) of the package.
# If the script has not completed by the specified timeout value,
# it will be terminated.  The default for each script timeout is
# NO_TIMEOUT.  Adjust the timeouts as necessary to permit full
# execution of each script.
# Note: The HALT_SCRIPT_TIMEOUT should be greater than the sum of
# all SERVICE_HALT_TIMEOUT specified for all services.

RUN_SCRIPT                 /etc/cmcluster/gmaxpkg/control.sh
RUN_SCRIPT_TIMEOUT         NO_TIMEOUT
HALT_SCRIPT                /etc/cmcluster/gmaxpkg/control.sh
HALT_SCRIPT_TIMEOUT        NO_TIMEOUT

# Enter the SERVICE_NAME, the SERVICE_FAIL_FAST_ENABLED and the
# SERVICE_HALT_TIMEOUT values for this package.  Repeat these  
# three lines as necessary for additional service names.  All  
# service names MUST correspond to the service names used by  
# cmrunserv and cmhaltserv commands in the run and halt scripts.
#
# The value for SERVICE_FAIL_FAST_ENABLED can be either YES or
# NO.  If set to YES, in the event of a service failure, the  
# cluster software will halt the node on which the service is  
# running.  If SERVICE_FAIL_FAST_ENABLED is not specified, the
# default will be NO.                                          
#
# SERVICE_HALT_TIMEOUT is represented in the number of seconds.
# This timeout is used to determine the length of time (in    
# seconds) the cluster software will wait for the service to  
# halt before a SIGKILL signal is sent to force the termination
# of the service.  In the event of a service halt, the cluster
# software will first send a SIGTERM signal to terminate the  
# service.  If the service does not halt, after waiting for the
# specified SERVICE_HALT_TIMEOUT, the cluster software will send
# out the SIGKILL signal to the service to force its termination.
# This timeout value should be large enough to allow all cleanup
# processes associated with the service to complete.  If the  
# 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.                  
#
SERVICE_NAME                   SchedulerSV
SERVICE_FAIL_FAST_ENABLED      YES
SERVICE_HALT_TIMEOUT           300
SERVICE_NAME                   SchedulerToolSV
SERVICE_FAIL_FAST_ENABLED      YES
SERVICE_HALT_TIMEOUT           300
SERVICE_NAME                   FacilitiesSV
SERVICE_FAIL_FAST_ENABLED      YES
SERVICE_HALT_TIMEOUT           300
SERVICE_NAME                   FacilitiesToolSV
SERVICE_FAIL_FAST_ENABLED      YES
SERVICE_HALT_TIMEOUT           300

# Enter the network subnet name that is to be monitored for this package.
# Repeat this line as necessary for additional subnet names.  If any of
# the subnets defined goes down, the package will be switched to another
# node that is configured for this package and has all the defined subnets
# available.

SUBNET                      172.1.1.0

# The following keywords (RESOURCE_NAME, RESOURCE_POLLING_INTERVAL, and
# RESOURCE_UP_VALUE) are used to specify Package Resource Dependencies.  To
# define a Package Resource Dependency, a RESOURCE_NAME line with a fully
# qualified resource path name, and one or more RESOURCE_UP_VALUE lines are
# required.  A RESOURCE_POLLING_INTERVAL line (how often in seconds the resource
# is to be monitored) is optional and defaults to 60 seconds.  An operator and
# a value are used with RESOURCE_UP_VALUE to define when the resource is to be
# considered up.  The operators are =, !=, >, <, >=, and <=, depending on the
# type of value.  Values can be string or numeric.  If the type is string, then
# only = and != are valid operators.  If the string contains whitespace, it
# must be enclosed in quotes.  String values are case sensitive.  For example,
#
# Resource is up when its value is
# --------------------------------
# RESOURCE_UP_VALUE = UP "UP"
# RESOURCE_UP_VALUE != DOWN Any value except "DOWN"
# 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     = 55    (threshold)
# RESOURCE_UP_VALUE     > 5.1 greater than 5.1    (threshold)
# RESOURCE_UP_VALUE     > -5 and < 10  between -5 and 10  (range)
#
# Note that "and" is required between the lower limit and upper limit
# when specifying a range.  The upper limit must be greater than the lower
# limit.  If RESOURCE_UP_VALUE is repeated within a RESOURCE_NAME block, then
# they are inclusively OR'd together.  Package Resource Dependencies may be
# defined by repeating the entire RESOURCE_NAME block.
#
# Example : RESOURCE_NAME          /net/lan/lan0/res1
#             RESOURCE_POLLING_INTERVAL    120
#             RESOURCE_UP_VALUE            = RUNNING
#             RESOURCE_UP_VALUE            = ONLINE
#
#             Means that the value of resource /net/lan/lan0/res1 will be
#     checked every 120 seconds, and is considered to be 'up' when
#     its value is "RUNNING" or "ONLINE".
#
# Uncomment the following lines to specify Package Resource Dependencies.
#
#RESOURCE_NAME                 <Full_path_name>
#RESOURCE_POLLING_INTERVAL  <numeric_seconds>
#RESOURCE_UP_VALUE     <op> <string_or_numeric> [and <op> <numeric>]

# The default for PKG_SWITCHING_ENABLED is YES. In the event of a
# failure, this permits the cluster software to transfer the package
# to an adoptive node.  Adjust as necessary.

PKG_SWITCHING_ENABLED               YES

# The default for NET_SWITCHING_ENABLED is YES.  In the event of a
# failure, this permits the cluster software to switch LANs locally
# (transfer to a standby LAN card).  Adjust as necessary.

NET_SWITCHING_ENABLED               YES

# 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.  Adjust as necessary.

NODE_FAIL_FAST_ENABLED      NO

(c) パッケージ制御スクリプト

#"(#) A.10.10         $Revision: 80.8 $ $Date: 97/07/17 08:45:04 $"
# **********************************************************************
# *                                                                    *
# *        HIGH AVAILABILITY PACKAGE CONTROL SCRIPT (template)         *
# *                                                                    *
# *       Note: This file MUST be edited before it can be used.        *
# *                                                                    *
# **********************************************************************
     
# UNCOMMENT the variables as you set them.

# Set PATH to reference the appropriate directories.
TERM=dtterm
export TERM
PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin

# VOLUME GROUP ACTIVATION:
# Specify the method of activation for volume groups.
# Leave the default ("VGCHANGE="vgchange -a e") if you want volume
# groups activated in exclusive mode. This assumes the volume groups have
# been initialized with 'vgchange -c y' at the time of creation.
#
# Uncomment the first line (VGCHANGE="vgchange -a e -q n"), and comment
# out the default, if your disks are mirrored on separate physical paths,
#
# Uncomment the second line (VGCHANGE="vgchange -a y") if you wish to
# use non-exclusive activation mode. Single node cluster configurations
# must use non-exclusive activation.
#
# VGCHANGE="vgchange -a e -q n"
# VGCHANGE="vgchange -a y"
VGCHANGE="vgchange -a e"            # Default
     
# VOLUME GROUPS
# Specify which volume groups are used by this package. Uncomment VG[0]=""
# and fill in the name of your first volume group. You must begin with
# VG[0], and increment the list in sequence.
#
# For example, if this package uses your volume groups vg01 and vg02, enter:
#         VG[0]=vg01
#         VG[1]=vg02
#
# The volume group activation method is defined above. The filesystems
# associated with these volume groups are specified below.
#
VG[0]="dev/vg03"

# FILESYSTEMS
# Specify the filesystems which are used by this package. Uncomment
# LV[0]=""; FS[0]=""; FS_MOUNT_OPT[0]="" and fill in the name of your first
# logical volume, filesystem and mount option for the file system. You must
# begin with LV[0], FS[0] and FS_MOUNT_OPT[0] and increment the list in
# sequence.
#
# For example, if this package uses the file systems pkg1a and pkg1b,
# which are mounted on the logical volumes lvol1 and lvol2 with read and
# write options enter:
#          LV[0]=/dev/vg01/lvol1; FS[0]=/pkg1a; FS_MOUNT_OPT[0]="-o rw"
#          LV[1]=/dev/vg01/lvol2; FS[1]=/pkg1b; FS_MOUNT_OPT[1]="-o rw"
#
# The filesystems are defined as triplets of entries specifying the logical
# volume, the mount point and the mount options for the file system. Each
# filesystem will be fsck'd prior to being mounted. The filesystems will be
# mounted in the order specified during package startup and will be unmounted
# in reverse order during package shutdown. Ensure that volume groups
# referenced by the logical volume definitions below are included in
# volume group definitions above.
#
LV[0]="/dev/vg03/lvol1";
FS[0]="/gmaxpkgd";
FS_MOUNT_OPT[0]="-o rw"

# IP ADDRESSES
# Specify the IP and Subnet address pairs which are used by this package.
# Uncomment IP[0]="" and SUBNET[0]="" and fill in the name of your first
# IP and subnet address. You must begin with IP[0] and SUBNET[0] and
# increment the list in sequence.
#
# For example, if this package uses an IP of 192.10.25.12 and a subnet of
# 192.10.25.0 enter:
#          IP[0]=192.10.25.12
#          SUBNET[0]=192.10.25.0 # (netmask=255.255.255.0)
#
# Hint: Run "netstat -i" to see the available subnets in the Network field.
#
# IP/Subnet address pairs for each IP address you want to add to a subnet
# interface card.  Must be set in pairs, even for IP addresses on the same
# subnet.
#
IP[0]="172.1.1.3"
SUBNET[0]="172.1.1.0"

# 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.54:0"
#          SERVICE_RESTART[0]=""  # Will not restart the service.
#
#          SERVICE_NAME[1]=pkg1b
#          SERVICE_CMD[1]="/usr/bin/X11/xload -display 192.10.25.54:0"
#          SERVICE_RESTART[1]="-r 2"   # Will restart the service twice.
#
#          SERVICE_NAME[2]=pkg1c
#          SERVICE_CMD[2]="/usr/sbin/ping"
#          SERVICE_RESTART[2]="-R" # Will restart the service an infinite
#                                    number of times.
#
# Note: No environmental variables will be passed to the command, this
# includes the PATH variable. Absolute path names are required for the
# service command definition.  Default shell is /usr/bin/sh.
#
SERVICE_NAME[0]="SchedulerSV"
SERVICE_CMD[0]="/usr/GroupAppo/bin/SFpakage -r SV"
SERVICE_RESTART[0]=""
SERVICE_NAME[1]="SchedulerToolSV"
SERVICE_CMD[1]="/usr/GroupAppo/bin/SFpakage -r AppoMan"
SERVICE_RESTART[1]=""
#以下の6行はFacilities Manager使用時のみ必要です。
SERVICE_NAME[2]="FacilitiesSV"
SERVICE_CMD[2]="/usr/GroupAppo/bin/SFpakage -r RMSV"
SERVICE_RESTART[2]=""
SERVICE_NAME[3]="FacilitiesToolSV"
SERVICE_CMD[3]="/usr/GroupAppo/bin/SFpakage -r RoomMan"
SERVICE_RESTART[3]=""

     
# DTC manager information for each DTC.
# Example: DTC[0]=dtc_20
#DTC_NAME[0]=
     
     
# START OF CUSTOMER DEFINED FUNCTIONS

# This function is a place holder for customer define functions.
# You should define all actions you want to happen here, before the service is
# started.  You can create as many functions as you need.  

function customer_defined_run_cmds
{
# ADD customer defined run commands.
: # do nothing instruction, because a function must contain some command.
#Address連携時はここにObjectServerとAddress Serverの起動コマンドを記述します
 /usr/GroupAppo/bin/SFpakage -s SV
 /usr/GroupAppo/bin/SFpakage -s AppoMan
#以下は,Facilities Manager使用時のみ記述します
 /usr/GroupAppo/bin/SFpakage -s RMSV
 /usr/GroupAppo/bin/SFpakage -s RoomMan

 test_return 51
}
     
# This function is a place holder for customer define functions.
# You should define all actions you want to happen here, before the service is
# halted.

function customer_defined_halt_cmds
{
# ADD customer defined halt commands.
: # do nothing instruction, because a function must contain some command.
 /usr/GroupAppo/bin/SFpakage -e SV
 /usr/GroupAppo/bin/SFpakage -e AppoMan
#以下は,Facilities Manager使用時のみ記述します
 /usr/GroupAppo/bin/SFpakage -e RMSV
 /usr/GroupAppo/bin/SFpakage -e RoomMan
#Address連携時はここにObjectServerとAddress Serverの停止コマンドを記述します
 test_return 52
}
     
# END OF CUSTOMER DEFINED FUNCTIONS

(2) AIX版

付録U.7で指定する始動スクリプト,停止スクリプト,及び監視スクリプトの例を示します。

(a) 始動スクリプト

#!/bin/sh
# 始動スクリプトの例 start

# Groupmax Object Server 及び Groupmax Address Server の起動

# Address連携時にはここにObject Server及びAddress Server の
# 起動スクリプトを記述する。

# Groupmax Scheduler Server 起動
/usr/GroupAppo/bin/SFpakage -s SV       # サーバ
if [ $? != 0 ]
 then
   exit 255
fi

/usr/GroupAppo/bin/SFpakage -s AppoMan  # 管理ツールサーバ
if [ $? != 0 ]
 then
   exit 255
fi

# Groupmax Facilities Manager 起動
# (Facilities Manager使用時のみ記述します。)
/usr/GroupAppo/bin/SFpakage -s RMSV     # サーバ
if [ $? != 0 ]
 then
   exit 255
fi

/usr/GroupAppo/bin/SFpakage -s RoomMan  # 管理ツールサーバ
if [ $? != 0 ]
 then
   exit 255
fi

exit 0

(b) 停止スクリプト

#!/bin/sh
# 停止スクリプトの例 stop

# Groupmax Scheduler Server 終了
/usr/GroupAppo/bin/SFpakage -e SV       # サーバ

/usr/GroupAppo/bin/SFpakage -e AppoMan  # 管理ツールサーバ

# Groupmax Facilities Manager 終了
# (Facilities Manager使用時のみ記述します。)
/usr/GroupAppo/bin/SFpakage -e RMSV     # サーバ

/usr/GroupAppo/bin/SFpakage -e RoomMan  # 管理ツールサーバ

# Groupmax Address Server 及び Groupmax Object Serverの終了

# Address連携時にはここにAddress Server及びObject Server の
# 停止スクリプトを記述する。

exit 0

(c) 監視スクリプト

#!/bin/sh
# 監視スクリプトの例monitor

# Groupmax Object Server 及び Groupmax Address Serverの状態取得

# Address連携時にはここに Object Server 及び Address Serverの
# 監視スクリプトを記述する。

# Groupmax Scheduler Server の状態取得
/usr/GroupAppo/bin/SFpakage -r SV       # サーバ
if [ $? != 0 ]
 then
   echo "monitor:Groupmax Scheduler Server down."
   exit 255
fi

/usr/GroupAppo/bin/SFpakage -r AppoMan  # 管理ツールサーバ
if [ $? != 0 ]
 then
   echo "monitor:Groupmax Scheduler Server Tool down."
   exit 255
fi

# Groupmax Facilities Manager 監視
# (Facilities Manager使用時のみ記述します。)

/usr/GroupAppo/bin/SFpakage -r RMSV     # サーバ
if [ $? != 0 ]
 then
   echo "monitor:Groupmax Facilities Manager down."
   exit 255
fi

/usr/GroupAppo/bin/SFpakage -r RoomMan  # 管理ツールサーバ
if [ $? != 0 ]
 then
   echo "monitor:Groupmax Facilities Manager Tool down."
   exit 255
fi

exit 0