 |
» |
|
|
 |
To configure a MC/ServiceGuard NFS package, complete the following tasks,
described in this section: Editing the Control
Script (nfs.cntl) |  |
The control script, nfs.cntl, is different with this release. For
MC/ServiceGuard NFS Toolkit A.11.00.04 or lower for HP-UX 11.0 or
MC/ServiceGuard NFS Toolkit A.11.11.01 or lower for HP-UX 11.11 using
MC/ServiceGuard A.11.09 (or below) framework, see “Editing nfs.cntl forNFS Toolkit A.11.00.04 & A.11.11.01
or lower.” to Edit the Control Script, nfs.cntl. Editing nfs.cntl for NFS Toolkit A.11.00.05 & A.11.11.02
and above.Starting with MC/ServiceGuard A.11.13,
a package can have LVM volume groups, CVM disk groups and VxVM disk
groups. Example steps: Create a
separate VG[n] variable for each LVM volume group that is used
by the package:
VG[0]=/dev/vg01 VG[1]=/dev/vg02 ... |
Create a separate VXVM_DG[n] variable for each VxVM disk group that is used
by the package:
VXVM_DG[0]=dg01 VXVM_DG[1]=dg02 ... |
Create a separate LV[n] and FS[n] variable for each volume group/disk group and
file system that will be mounted on the server: For the LVM 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" |
For the VxVM example, if this package uses the file systems
pkg1a and pkg1b, which are mounted on the volumes lvol1 and lvol2
with read and write options enter: LV[0]="/dev/vx/dsk/dg01/vol01"; FS[0]="/pkg1a"; FS_MOUNT_OPT[0]="-o rw" LV[1]="/dev/vx/dsk/dg01/vol02"; FS[1]="/pkg1b"; FS_MOUNT_OPT[1]="-o rw" |
Specify the IP address for the package and the address
of the subnet to which the IP address belongs: IP[0]=15.13.114.243 SUBNET[0]=15.13.112.0 |
The IP address you specify is the relocatable IP address for
the package. NFS clients that mount the file systems in the package
will use this IP address to identify the server. You should configure
a name for this address in the DNS or NIS database, or in the /etc/hosts file. If two packages have the same adoptive node, and
you want to prevent the adoptive node from adopting both packages
at once, specify the cmmodpkg command with the package control option (-d) in the customer_defined_run_cmds: function customer_defined_run_cmds { cmmodpkg -d -n 'hostname' pkg02 & } |
The package control option can prevent an adoptive node from becoming
overloaded when multiple packages fail over. If an adoptive node
becomes overloaded, it can fail.
In this example, if a host is an adoptive node for both pkg01 and pkg02, the above cmmodpkg -d command, in the control script for pkg01, would prevent the host that is running pkg01 from adopting pkg02. A similar line in the control script for pkg02 could prevent the host that is running pkg02 from adopting pkg01. The ampersand (&) causes the cmmodpkg command to run in the background. It must run
in the background to allow the control script to finish bringing
up the package. The cmmodpkg command will hang until the package is up, so
it must run in the background to allow the control script to complete. There is a short time, after one package has failed over but
before the cmmodpkg command has executed, when the other package can
fail over and the host will adopt it. In other words, if two packages
fail over at approximately the same time, a host may adopt both
packages, even though the package control option is specified. See “One Adoptive Node for
Two Packages” for a sample configuration
using the package control option. Editing nfs.cntl forNFS Toolkit A.11.00.04 & A.11.11.01
or lower.For MC/ServiceGuard NFS Toolkit A.11.00.04 or lower for HP-UX
11.0 or MC/ServiceGuard NFS Toolkit A.11.11.01 or lower for HP-UX
11.11 using MC/ServiceGuard A.11.09 (or below) framework. Example
steps: Create a separate VG[n] variable for each volume group. VG[0]=/dev/vg01 VG[1]=/dev/vg02 ... |
Create a separate LV[n] and FS[n] variable for each volume group and file system
that will be mounted on the server:. LV[0]=/dev/vg01/lvol1;FS[0]=/ha_root LV[1]=/dev/vg01/lvol2;FS[1]=/users/scaf LV[2]=/dev/vg02/lvol1;FS[2]=/ha_data |
Create a separate XFS[n] variable for each NFS directory to be exported.
Specify the directory name and any export options. XFS[0]="/ha_root" XFS[1]="/users/scaf" XFS[2]="-o ro /ha_data" |
Do not configure these exported directories in the /etc/exports file. When an NFS server boots up, it attempts
to export all file systems in its /etc/exports file. If those file systems are not currently
present on the NFS server node, the node cannot boot properly. This
happens if the server is an adoptive node for a file system, and
the file system is available on the server only after failover of
the primary node. Specify the IP address for the package and the address
of the subnet to which the IP address belongs. IP[0]=15.13.114.243 SUBNET[0]=15.13.112.0 |
The IP address you specify is the relocatable IP address for
the package. NFS clients that mount the file systems in the package
will use this IP address to identify the server. You should configure
a name for this address in the DNS or NIS database, or in the /etc/hosts file. If you want to run the NFS monitor script , set
the NFS_SERVICE_NAME variable to the value of the SERVICE_NAME variable in the package configuration file. Each
package must have a unique service name. NFS_SERVICE_NAME[0]=nfs1.monitor |
If you do not want to run the NFS monitor script, comment
out the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables: # NFS_SERVICE_NAME[0]=nfs.monitor # NFS_SERVICE_CMD[0]=/etc/cmcluster/nfs/nfs.mon |
By default, the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables are commented out, and the NFS monitor
script is not run. You do not have to run the NFS monitor script. If your NFS
package configuration file specifies PKG_SWITCHING_ENABLED YES and NET_SWITCHING_ENABLED YES (the defaults), the package will switch to the
next adoptive node or to a standby network interface in the event
of a node or network failure. The NFS monitor script causes the package
to fail over if any of the monitored NFS services fails. NFS services
are monitored if they are configured in the /etc/rc.config.d/nfsconf file to be started at system boot. If you set
the NFS_SERVER variable to 1, the nfsd, rpc.lockd, and rpc.statd processes are monitored. If you set the PCNFS_SERVER variable to 1, the pcnfsd process is monitored. If you set the START_MOUNTD variable to 1, the rpc.mountd process is monitored. If you run the NFS monitor script, set the NFS_SERVICE_CMD variable to the full path name of the NFS monitor
script. NFS_SERVICE_CMD[0]=/etc/cmcluster/nfs/nfs.mon |
The path name for the executable script does not have to be
unique to each package. Every package can use the same script. Multiple instances
of the monitor script can run on the same node without any problems,
and if a package fails over, only the instance associated with that
package is killed. If you do not want to run the NFS monitor script, comment
out the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables: # NFS_SERVICE_NAME[0]=nfs.monitor # NFS_SERVICE_CMD[0]=/etc/cmcluster/nfs/nfs.mon |
By default, the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables are commented out, and the NFS monitor
script is not run. If two packages have the same adoptive node, and
you want to prevent the adoptive node from adopting both packages
at once, specify the cmmodpkg command with the package control option (-d) in the customer_defined_run_cmds. function customer_defined_run_cmds { cmmodpkg -d -n 'hostname' pkg02 & } |
The package control option can prevent an adoptive node from becoming
overloaded when multiple packages fail over. If an adoptive node
becomes overloaded, it can fail.
In this example, if a host is an adoptive node for both pkg01 and pkg02, the above cmmodpkg -d command, in the control script for pkg01, would prevent the host that is running pkg01 from adopting pkg02. A similar line in the control script for pkg02 could prevent the host that is running pkg02 from adopting pkg01. The ampersand (&) causes the cmmodpkg command to run in the background. It must run
in the background to allow the control script to finish bringing
up the package. The cmmodpkg command will hang until the package is up, so
it must run in the background to allow the control script to complete. There is a short time, after one package has failed over but
before the cmmodpkg command has executed, when the other package can
fail over and the host will adopt it. In other words, if two packages
fail over at approximately the same time, a host may adopt both
packages, even though the package control option is specified. See “One Adoptive Node for
Two Packages”"One Adoptive Node
for Two Packages" on page 52 for a sample configuration
using the package control option. Editing the NFS Control Script (hanfs.sh) |  |
There is a new control script, hanfs.sh that contains NFS specific control variables and
functions for NFS Toolkit A.11.00.05 & A.11.11.02 and above.
Example steps: Create a separate XFS[n] variable for each NFS directory to be exported.
Specify the directory name and any export options. The directories
must be defined in the above mounted file system FS list. XFS[0]="-o ro /pkg1a" XFS[1]="-o rw /pkg1b" |
Do not configure these exported directories in the /etc/exports file. When an NFS server boots up, it attempts
to export all file systems in its /etc/exports file. If those file systems are not currently
present on the NFS server node, the node cannot boot properly. This
happens if the server is an adoptive node for a file system, and
the file system is available on the server only after failover of
the primary node. If you wish to monitor NFS services (with running
the NFS monitor script), set the NFS_SERVICE_NAME variable. NFS_SERVICE_NAME[0]=nfs1.monitor |
If you do not want to run the NFS monitor script, comment
out the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables: # NFS_SERVICE_NAME[0]=nfs.monitor # NFS_SERVICE_CMD[0]=/etc/cmcluster/nfs/nfs.mon |
By default, the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables are commented out, and the NFS monitor
script is not run. You do not have to run the NFS monitor script. If your NFS
package configuration file specifies AUTO_RUN YES and LOCAL_LAN_FAILOVER_ALLOWED YES (the defaults), the package will switch to the
next adoptive node or to a standby network interface in the event
of a node or network failure. The NFS monitor script causes the
package to fail over if any of the monitored NFS services fails. NFS
services are monitored if they are configured in the NFS configuration
file, /etc/rc.config.d/nfsconf to be started at system boot. If you set the NFS_SERVER variable to 1, the nfsd, rpc.lockd, and rpc.statd processes are monitored. If you set the PCNFS_SERVER variable to 1, the pcnfsd process is monitored.
If you set the START_MOUNTD variable to 1, the rpc.mountd process is monitored. 3. If you run the NFS monitor script, set the NFS_SERVICE_CMD variable to the full path name of the NFS monitor
script. NFS_SERVICE_CMD[0]=/etc/cmcluster/nfs/nfs.mon |
The path name for the executable script does not have to be
unique to each package. Every package can use the same script. Multiple instances
of the monitor script can run on the same node without any problems,
and if a package fails over, only the instance associated with that
package is killed. If you do not want to run the NFS monitor script, comment
out the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables: # NFS_SERVICE_NAME[0]=nfs.monitor # NFS_SERVICE_CMD[0]=/etc/cmcluster/nfs/nfs.mon |
By default, the NFS_SERVICE_NAME and NFS_SERVICE_CMD variables are commented out, and the NFS monitor
script is not run.
Editing the Package
Configuration File (nfs.conf) |  |
Set the PACKAGE_NAME variable. You can use the default package name if you will run only
one MC/ServiceGuard NFS package on your MC/ServiceGuard cluster. Each
package must have a unique name. Create a NODE_NAME variable for each node that will run the package. The
first NODE_NAME should specify the primary node. All the NODE_NAME variables following the primary node should specify
the adoptive nodes, in the order in which they will be tried. NODE_NAME thyme NODE_NAME basil NODE_NAME sage |
Set the RUN_SCRIPT and HALT_SCRIPT variables to the full path name of the control
script (/etc/cmcluster/nfs/nfs.cntl or whatever you have renamed it). You do not have
to specify a timeout for either script. RUN_SCRIPT /etc/cmcluster/nfs/nfs1.cntl RUN_SCRIPT_TIMEOUT NO_TIMEOUT HALT_SCRIPT /etc/cmcluster/nfs/nfs1.cntl HALT_SCRIPT_TIMEOUT NO_TIMEOUT |
If you want to run the NFS monitor script , set
the SERVICE_NAME variable to indicate the NFS monitor script. SERVICE_NAME nfs1.monitor |
Each package must have a unique service name. The SERVICE_NAME variable in the package configuration file must
match the NFS_SERVICE_NAME variable in the control script. If you do not wish to run the NFS monitor script, comment
out the SERVICE_NAME variable: # SERVICE_NAME nfs.monitor |
You do not have to run the NFS monitor script. If your NFS
package configuration file specifies AUTO_RUN YES and LOCAL_LAN_FAILOVER_ALLOWED YES (the defaults), the package will switch to the
next adoptive node or to a standby network interface in the event
of a node or network failure. The NFS monitor script causes the
package to fail over if any of the monitored NFS services fails. NFS
services are monitored if they are configured in the /etc/rc.config.d/nfsconf file to be started at system boot. If you set
the NFS_SERVER variable to 1, the nfsd, rpc.lockd, and rpc.statd processes are monitored. If you set the PCNFS_SERVER variable to 1, the pcnfsd process is monitored. If you set the START_MOUNTD variable to 1, the rpc.mountd process is monitored. Set the SUBNET variable to the subnet that will be monitored
for the package.
You can use the default values for the rest of the variables
in the package configuration file, or you can change them as needed.
For instructions on modifying the default values, see the Managing
MC/ServiceGuard manual, or read the comments in the /opt/cmcluster/nfs/nfs.conf template file. Configuring Server-to-Server
Cross-Mounts (Optional) |  |
Two NFS server nodes may NFS-mount each other's file
systems and still act as adoptive nodes for each other's
NFS server packages. Figure 2-1 “Server-to-Server Cross-Mounting” illustrates this
configuration. The advantage of server-to-server cross-mounting is that every
server has an identical view of the file systems. The disadvantage
is that, on the node where a file system is locally mounted, the
file system is accessed through an NFS mount, which has poorer performance
than a local mount. In order to make a MC/ServiceGuard file system available to
all servers, all servers must NFS-mount the file system. That way,
access to the file system is not interrupted when the package fails
over to an adoptive node. An adoptive node cannot access the file
system through the local mount, because it would have to unmount
the NFS-mounted file system before it could mount it locally. And
in order to unmount the NFS-mounted file system, it would have to
kill all processes using the file system. Follow these steps to set up an NFS package with file systems
that are NFS-mounted by MC/ServiceGuard NFS servers: Make a copy of the /etc/cmcluster/nfs/nfs_xmnt script. cd /etc/cmcluster/nfs cp nfs_xmnt nfs1_xmnt |
In the copy of the nfs_xmnt script, create an SNFS[n] and CNFS[n] variable for each file system in the package that
will be NFS-mounted by servers. The SNFS[n] variable is the server location of the file system,
and the CNFS[n] variable is the client mount point of the file system. SNFS[0]="nfs1:/hanfs/nfsu011";CNFS[0]="/nfs/nfsu011" |
In this example, "nfs1" is the name that maps to the package's relocatable
IP address. It must be configured in the name service used by the
server (DNS, NIS, or the /etc/hosts file). If a server for the package will NFS-mount the package's
file systems, the client mount point (CNFS) must be different from the
server location (SNFS). Copy the script you have just modified to all the
servers that will NFS-mount the file systems in the package. After the package is active on the primary node,
execute the nfs_xmnt script on each server that will NFS-mount the
file systems. /etc/cmcluster/nfs/nfs1_xmnt start |
Hewlett-Packard recommends that you execute the nfs_xmnt script from the command line after the package
is active on the primary node. However, you can configure the nfs_xmnt script to be executed by the NFS control script
in the customer_defined_run_cmds function. function customer_defined_run_cmds { /etc/cmcluster/nfs/nfs1_xmnt start remsh sage /etc/cmcluster/nfs/nfs1_xmnt start } |
The second line in the function invokes remsh to run the nfs_xmnt script on remote host sage. Running the nfs_xmnt script from the NFS control script guarantees that
the package is active before the mount command executes. It prevents cross-mounted servers
from becoming deadlocked while each server hangs on the mount command, waiting for the other server's
package to become active. However, if the package fails to activate,
or if the remsh command fails, the file systems will not be mounted,
and no error will be returned. The only way to be sure the file
systems are mounted successfully is to run the nfs_xmnt script manually on each host where the file systems
should be mounted.
For an example of a configuration with cross-mounted servers,
see “Two Servers with NFS
Cross-Mounts”. Creating the MC/ServiceGuard
Binary Configuration File |  |
Use the cmapplyconf command to verify the content of your cluster and
package configuration and to copy the binary configuration file
to all the nodes in the cluster. In the following example, the cluster configuration
file is /etc/cmcluster/cluster.conf, and the NFS package configuration file is /etc/cmcluster/nfs/nfs.conf. On your system, use the names of your own cluster
configuration and package configuration files. # cmapplyconf -v -C /etc/cmcluster/cluster.conf \ -P /etc/cmcluster/nfs/nfs.conf |
Use your favorite copy utility (for example, ftp or rcp) to copy the package control and monitor scripts
to the same path names on all the nodes in the cluster. For example,
to copy the files from host thyme to host basil, issue the following command from host thyme: # rcp /etc/cmcluster/nfs/* basil:/etc/cmcluster/nfs |
|