Sun Cluster 3.0 U1 Data Services Installation and Configuration Guide

Chapter 7 Installing and Configuring Sun Cluster HA for Network File System (NFS)

This chapter describes the steps to install and configure the Sun Cluster HA for Network File System (NFS) data service on your Sun Cluster servers and the steps to add the Sun Cluster HA for NFS data service to a system that already runs the Sun Cluster software.

This chapter contains the following procedures.

You must configure the Sun Cluster HA for NFS data service as a failover service. See Chapter 1, Planning for Sun Cluster Data Services and the Sun Cluster 3.0 U1 Concepts document for general information about data services, resource groups, resources, and other related topics.


Note -

You can use SunPlex Manager to install and configure this data service. See the SunPlex Manager online help for details.


Use the worksheets in Sun Cluster 3.0 U1 Release Notes to plan your resources and resource groups before you install and configure the Sun Cluster HA for NFS data service.

The mount points for NFS file systems placed under the control of the Sun Cluster HA for NFS data service must be the same on all the nodes that are capable of mastering the disk device group that contains those file systems.


Note -

To avoid any failures because of name-service lookup, ensure that all logical hostnames are present in the server's /etc/hosts file. Configure name-service mapping in the /etc/nsswitch.conf file on the servers to first check the local files before trying to access NIS or NIS+. Doing so prevents timing-related errors in this area and ensures that ifconfig and statd succeed in resolving logical hostnames.



Note -

To avoid "stale file handle" errors on the client during NFS failover, if you use VERITAS Volume Manager, ensure that the vxio driver has identical pseudo-device major numbers on all the cluster nodes. You can find this number in the /etc/name_to_major file after you complete the installation.


Installing and Configuring Sun Cluster HA for NFS

The following table lists the sections that describe the installation and configuration tasks.

Table 7-1 Task Map: Installing and Configuring Sun Cluster HA for NFS

Task 

For Instructions, Go To ... 

Install Sun Cluster HA for NFS packages 

"Installing Sun Cluster HA for NFS Packages"

Set up and configure the Sun Cluster HA for NFS data service 

"Setting Up and Configuring Sun Cluster HA for NFS"

Configure resource extension properties 

"Configuring Sun Cluster HA for NFS Extension Properties"

View fault-monitor information 

"Sun Cluster HA for NFS Fault Monitor"

Installing Sun Cluster HA for NFS Packages

You can use the scinstall(1M) utility to install SUNWscnfs, the Sun Cluster HA for NFS data-service package, on a cluster. Do not use the -s option to non-interactive scinstall to install all data-service packages.

If you installed the SUNWscnfs data-service package during your initial Sun Cluster installation, proceed to "Setting Up and Configuring Sun Cluster HA for NFS". Otherwise, use the following procedure to install the SUNWscnfs package.

How to Install Sun Cluster HA for NFS Packages

You need the Sun Cluster Agents CD to complete this procedure. Run this procedure on all cluster nodes that can run the Sun Cluster HA for NFS data service.

  1. Load the Agents CD into the CD-ROM drive.

  2. Run the scinstall utility with no options.

    This step starts the scinstall utility in interactive mode.

  3. Select the Add Support for New Data Service to This Cluster Node menu option.

    This option enables you to load software for any data services that exist on the CD.

  4. Exit the scinstall utility.

  5. Unload the CD from the drive.

Where to Go From Here

See "Setting Up and Configuring Sun Cluster HA for NFS" to register the Sun Cluster HA for NFS data service and to configure the cluster for the data service.

Setting Up and Configuring Sun Cluster HA for NFS

This procedure describes how to use the scrgadm(1M) command to register and configure the Sun Cluster HA for NFS data service.


Note -

Other options also enable you to register and configure the data service. See "Tools for Data-Service Resource Administration" for details about these options.


Before you set up and configure the Sun Cluster HA for NFS data service, run the following command to verify that the Sun Cluster HA for NFS package SUNWscnfs has been installed on the cluster.


# pkginfo -l SUNWscnfs

If the package has not been installed, see "Installing Sun Cluster HA for NFS Packages" for instructions on how to install the package.

How to Set Up and Configure Sun Cluster HA for NFS

  1. Become superuser on a cluster member.

  2. Verify that all nodes in the cluster are up and running.


    # scstat
    
  3. Create a failover resource group to contain the NFS resources.


    Note -

    You must define Pathprefix, which is a directory on a cluster file system that the Sun Cluster HA for NFS data service uses to maintain administrative and status information, for the Sun Cluster HA for NFS resource group. You can specify any directory for this purpose, but you must create the directory on the cluster file system.



    # scrgadm -a -g resource-group -y Pathprefix=/global/admin-dir
    

    Note -

    The admin-dir directory must be on a cluster file system. You must manually create this directory.


    -a -g resource-group

    Adds the named failover resource group.

    -y Pathprefix=path

    Specifies a directory on a cluster file system for Sun Cluster HA for NFS administration files to use. For example, /global/nfs. Pathprefix must be unique for each resource group that you create.

  4. Verify that all logical hostnames that you will use have been added to your name-service database.

    You should have performed this verification during the Sun Cluster installation. See the planning chapter in the Sun Cluster 3.0 U1 Installation Guide for details on this step.


    Note -

    To avoid any failures because of name-service lookup, verify that all logical hostnames are present in the server's and client's /etc/hosts file. Configure name-service mapping in the /etc/nsswitch.conf file on the servers to first check the local files before trying to access NIS or NIS+. Doing so prevents timing-related errors in this area and ensures that ifconfig and statd succeed in resolving logical hostnames.


  5. Add the desired logical-hostname resources into the failover resource group.

    You must set up a LogicalHostname resource with this step. The hostname used with the Sun Cluster HA for NFS data service cannot be a SharedAddress resource.


    # scrgadm -a -L -g resource-group -l logical-hostname, ... [-n netiflist]
    -a -L -g resource-group

    Specifies the failover resource group into which to place the logical-hostname resources.

    -l logical-hostname, ...

    Specifies the network resources (logical hostnames) to be added.

    -n netiflist

    Specifies an optional comma-separated list that identifies the NAFO groups on each node. All the nodes in nodelist of the resource group must be represented in netiflist. If you do not specify this option, scrgadm(1M) attempts to discover a net adapter on the subnet that the hostname list identifies for each node in nodelist.

  6. From any node of the cluster, create a directory structure for the NFS configuration files.

    Create the administrative subdirectory directory below the directory that the Pathprefix property identifies in Step 3, for example, /global/nfs/SUNW.nfs.


    # mkdir Pathprefix/SUNW.nfs
  7. Create a dfstab.resource file in the SUNW.nfs directory created in Step 6, and set up share options.

    For example, create the Pathprefix/SUNW.nfs/dfstab.resource file, which contains a set of share commands with the shared path names. The shared paths should be subdirectories on a cluster file system.

    Choose a resource-name suffix to identify the NFS resource that you plan to create (in Step 9). A good resource name would refer to the task that this resource is expected to perform. For example, a name such as user-nfs-home is a good candidate for an NFS resource that shares user home directories.

    Set up the share options for each path that you have created to be shared. The format of this file is exactly the same as the format that is used in the /etc/dfs/dfstab file.


    share [-F nfs] [-o] specific_options [-d "description"] pathname 
    
    -F nfs

    Identifies the file system type as nfs.

    -o specific_options

    See the share(1M) man page for a list of options. You should set the rw option for Sun Cluster. This command grants read-write access to all clients.

    -d description

    Describes the file system being added.

    pathname

    Identifies the file system being shared.

    The share -o rw command grants write access to all clients, including the hostnames that the Sun Cluster software uses and enables Sun Cluster HA for NFS fault monitoring to operate most efficiently. See the following man pages for details.

    • dfstab(4)

    • share(1M)

    • share_nfs(1M)

    If you specify a client list in the share command, include all physical and logical hostnames that are associated with the cluster, as well as the hostnames for all clients on all public networks to which the cluster is connected.

    If you use net groups in the share command (rather than names of individual hosts), add all those cluster hostnames to the appropriate net group.


    Note -

    Do not grant access to the hostnames on the cluster interconnect.


    Grant read and write access to all the cluster nodes and logical hosts to enable the Sun Cluster HA for NFS monitoring to do a thorough job. However, you can restrict write access to the file system or make the file system entirely read-only. If you do so, Sun Cluster HA for NFS fault monitoring can still perform monitoring without having write access.


    Note -

    When constructing share options, do not use the root option, and do not mix the ro and rw options.


  8. Register the NFS resource type.


    # scrgadm -a -t resource-type
    
    -a -t resource-type

    Adds the specified resource type. For the Sun Cluster HA for NFS data service, the resource type is SUNW.nfs.

  9. Create the NFS resource in the failover resource group.


    # scrgadm -a -j resource -g resource-group -t resource-type
    
    -a

    Adds a resource.

    -j resource

    Specifies the name of the resource to add, which you defined in Step 7. This name can be your choice but must be unique within the cluster.

    -g resource-group

    Specifies the name of a previously created resource group to which this resource is to be added.

    -t resource-type

    Specifies the name of the resource type to which this resource belongs. This name must be the name of a registered resource type.

  10. Run the scswitch(1M) command to perform the following tasks.

    • Enable the resource and the resource monitor.

    • Manage the resource group.

    • Switch the resource group into the online state.


    # scswitch -Z -g resource-group
    

Example - Setting Up and Configuring Sun Cluster HA for NFS

The following example shows how to set up and configure the Sun Cluster HA for NFS data service.


(Create a logical host resource group and specify the path to the administrative files used by NFS (Pathprefix).)
# scrgadm -a -g resource-group-1 -y Pathprefix=/global/nfs
 
(Add logical hostname resources into the logical host resource group.)
# scrgadm -a -L -g resource-group-1 -l schost-1
 
(Make the directory structure contain the Sun Cluster HA for NFS configuration files.)
# mkdir -p /global/nfs/SUNW.nfs
 
(Create the dfstab.resource file under the nfs/SUNW.nfs directory and set share options.)
 
(Register the NFS Resource Type.)
# scrgadm -a -t SUNW.nfs
 
(Create the NFS resource in the resource group.)
# scrgadm -a -j r-nfs -g resource-group-1 -t SUNW.nfs
 
(Enable the resources and their monitors, manage the resource group, and switch the resource group into online state.)
# scswitch -Z -g resource-group-1

Where to Go From Here

See "How to Change Share Options on an NFS File System" to set share options for your NFS file systems. See "Configuring Sun Cluster HA for NFS Extension Properties" to review or set extension properties.

How to Change Share Options on an NFS File System

If you use the rw, rw=, ro, or ro= options to the share -o command, NFS fault monitoring works best if you grant access to all the physical hosts or netgroups associated with all Sun Cluster servers.

If you use netgroups in the share(1M) command, add all of the Sun Cluster hostnames to the appropriate netgroup. Ideally, grant both read and write access to all of the Sun Cluster hostnames to enable the NFS fault probes to do a complete job.


Note -

Before you change share options, read the share_nfs(1M) man page to understand which combinations of options are legal.


  1. Become superuser on a cluster node.

  2. Turn off fault monitoring on the NFS resource.


    # scswitch -n -M -j resource
    
    -M

    Disables the resource monitor.

  3. Execute your proposed new share command.

    Before you edit the dfstab.resource file with new share options, execute the new share command to verify the validity of your combination of options.


    # share -F nfs [-o] specific_options [-d "description"] pathname
    
    -F nfs

    Identifies the file system type as NFS.

    -o specific_options

    Specifies an option. You might use rw, which grants read-write access to all clients.

    -d description

    Describes the file system being added.

    pathname

    Identifies the file system being shared.

    If the new share command fails, immediately execute another share command with the old options. When the new command executes successfully, proceed to Step 4.

  4. Edit the dfstab.resource file with the new share options.

    The format of this file is exactly the same as the format that is used in the /etc/dfs/dfstab file. Each line consists of a share command.

  5. (Optional) If you are removing a path from the dfstab.resource file, execute the unshare(1M) command, then remove the share command for the path from the dfstab.resource file.


    # unshare [-F nfs] [-o rw] pathname
    # vi dfstab.resource
    
    -F nfs

    Identifies the file system type as NFS.

    -o options

    Specifies the options that are specific to NFS file systems.

    pathname

    Identifies the file system being made unavailable.

  6. (Optional) If you are adding a path to or changing an existing path in the dfstab.resource file, verify that the mount point is valid, then perform Step 3 and Step 4.

  7. Enable fault monitoring on the NFS resource.


    # scswitch -e -M -j resource
    

How to Tune Sun Cluster HA for NFS Method Timeouts

The time Sun Cluster HA for NFS methods take to finish depends on the number of paths that the resources share through the dfstab.resource file. The default timeout for these methods is 300 seconds. A simple rule of thumb is to allocate 10 seconds toward the method time-out values for each path shared. Because the default timeouts are designed to handle 30 shared paths, if the number of shared paths is less than 30, do not reduce the timeout.

If the number of shared paths exceeds 30, however, multiply that number by 10 to compute the recommended timeout. For example, if the dfstab.resource file contains 50 shared paths, the recommended timeout is 500 seconds.

Change the following method timeouts.

Prenet_start_timeoutPostnet_stop_timeoutMonitor_Start_timeout
Start_timeoutValidate_timeoutMonitor_Stop_timeout
Stop_timeoutUpdate_timeoutMonitor_Check_timeout

To change method timeouts, use the scrgadm -c option, as in the following example.


% scrgadm -c -j resource -y Prenet_start_timeout=500

How to Configure SUNW.HAStorage Resource Type

The SUNW.HAStorage resource type synchronizes actions between HA storage and the data service. The Sun Cluster HA for NFS data service is disk-intensive, and therefore you should set up the SUNW.HAStorage resource type.

See the SUNW.HAStorage(5) man page and "Relationship Between Resource Groups and Disk Device Groups" for background information. See "How to Set Up SUNW.HAStorage Resource Type for New Resources" for the procedure.

Configuring Sun Cluster HA for NFS Extension Properties

Typically, you use the command line scrgadm -x parameter=value to configure extension properties when you create the NFS resource. You can also use the procedures in Chapter 11, Administering Data-Service Resources to configure them later. You are not required to set any extension properties for the Sun Cluster HA for NFS data service. See Appendix A, Standard Properties for details of all Sun Cluster properties.

Table 7-2 describes extension properties that you can configure for the Sun Cluster HA for NFS data service. You can update some properties dynamically. You can update others, however, only when you create the resource. The Tunable column indicates when you can update the property.

Table 7-2 Sun Cluster HA for NFS Extension Properties

Name/Data Type 

Default 

Range 

Tunable 

Description 

Lockd_nullrpc_timeout (integer)

120

Minimum = 60

Any time 

The time-out value (in seconds) to use when probing lockd.

Monitor_retry_count (integer)

4

0 - 2,147,483,641

 

-1 indicates an infinite number of restart attempts.

Any time 

The number of times that the process monitor facility (PMF) restarts the fault monitor during the time window that the Monitor_retry_interval property specifies. Note that this property refers to restarts of the fault monitor itself, rather than the resource. The system-defined properties Retry_interval and Retry_count control restarts of the resource. See the scrgadm(1M) man page for a description of these properties.

Monitor_retry_interval (integer)

2

0 - 2,147,483,641

 

-1 indicates an infinite amount of time.

Any time 

The time (in minutes) over which failures of the fault monitor are counted. If the number of times that the fault monitor fails is more than the value that is specified in the extension property Monitor_retry_count within this period, the PMF restarts the fault monitor.

Mountd_nullrpc_restart (Boolean)

True

None 

Any time 

A Boolean to indicate whether to restart mountd when a null rpc call fails.

Mountd_nullrpc_timeout (integer)

120

Minimum = 60

Any time 

The time-out value (in seconds) to use when probing mountd.

Nfsd_nullrpc_restart (Boolean)

True

None 

Any time 

A Boolean to indicate whether to restart nfsd when a null rpc call fails.

Nfsd_nullrpc_timeout (integer)

120

Minimum = 60

Any time 

The time-out value (in seconds) to use when probing nfsd.

Rpcbind_nullrpc_reboot (Boolean)

True

None 

Any time 

A Boolean to indicate whether to reboot the system when a null rpc call on rpcbind fails.

Rpcbind_nullrpc_timeout (integer)

120

Minimum = 60

Any time 

The time-out value (in seconds) to use when probing rpcbind.

Statd_nullrpc_timeout (integer)

120

Minimum = 60

Any time 

The time-out value (in seconds) to use when probing statd.

Sun Cluster HA for NFS Fault Monitor

The Sun Cluster HA for NFS fault monitor involves the following two processes.

Fault Monitor Startup

An NFS resource start method starts the NFS system fault monitor. This start method first checks if the NFS system fault monitor (nfs_daemons_probe) is already running under the process monitor pmfadm. If not, the start method starts the nfs_daemons_probe process under the control of the process monitor. It then starts the resource fault monitor (nfs_probe), also under the control of the process monitor.

Fault Monitor Stops

The NFS resource Monitor_stop method stops the resource fault monitor. This method also stops the NFS system fault monitor if no other NFS resource fault monitor runs on the local node.

NFS System Fault Monitor Process

To check for the presence of the process and its response to a null rpc call, the system fault monitor probes rpcbind, statd, lockd, nfsd, and mountd. This monitor uses the following NFS extension properties.

Rpcbind_nullrpc_timeoutLockd_nullrpc_timeout
Nfsd_nullrpc_timeoutRpcbind_nullrpc_reboot
Mountd_nullrpc_timeoutNfsd_nullrpc_restart

Statd_nullrpc_timeout

Mountd_nullrpc_restart

See "Configuring Sun Cluster HA for NFS Extension Properties" to review or set extension properties.

Each system fault monitor probe cycle performs the following steps.

  1. Sleeps for Cheap_probe_interval.

  2. Probes rpcbind.

    If the process fails, reboots the system if Failover_mode=HARD.

    If a null rpc call fails and if Rpcbind_nullrpc_reboot=True and Failover_mode=HARD, reboots the system.

  3. Probes statd and lockd.

    If either of these daemons fails, restarts both.

    If a null rpc call fails, logs a message to syslog but does not restart.

  4. Probe nfsd and mountd.

    If the process fails, restart it.

    If a null rpc call fails, restart mountd if the cluster file system device is available and the extension property Mountd_nullrpc_restart=True.

If any of the NFS daemons fail to restart, the status of all online NFS resources is set to FAULTED. When all NFS daemons are restarted and healthy, the resource status is set to ONLINE again.

NFS Resource Monitor Process

Before starting the resource monitor probes, all shared paths are read from the dfstab file and stored in memory. In each probe cycle, all shared paths are probed in each iteration by performing stat() of the path.

Each resource monitor fault probe performs the following steps.

  1. Sleeps for Thorough_probe_interval.

  2. Refreshes the memory if dfstab has been changed since the last read.

  3. Probes all shared paths in each iteration by preforming stat() of the path.

If any path is not functional, the resource status is set to FAULTED. If all paths are functional, the resource status is set to ONLINE again.