Sun Cluster 3.0 Data Services Installation and Configuration Guide

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

This chapter describes the steps for installing and configuring Sun Cluster HA for Network File System (NFS) on your Sun Cluster servers and the steps for adding Sun Cluster HA for NFS to a system that is already running Sun Cluster.

This chapter contains the following procedures:

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

Use the worksheets in Sun Cluster 3.0 Release Notes to plan your resources and resource groups before installing and configuring Sun Cluster HA for NFS.

The mount points for NFS file systems placed under the control of Sun Cluster HA for NFS 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 host names are present in the server's /etc/hosts file. Configure name service mapping in /etc/nsswitch.conf 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 host names.



Note -

To avoid "stale file handle" errors on the client during NFS failover, if you are using 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 completing the installation.


Installing and Configuring Sun Cluster HA for NFS

Table 7-1 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 Sun Cluster HA for NFS 

"Setting Up and Configuring Sun Cluster HA for NFS"

Configure resource extension properties 

"Configuring Sun Cluster HA for NFS Extension Properties"

Installing Sun Cluster HA for NFS Packages

The scinstall(1M) utility installs SUNWscnfs, the Sun Cluster HA for NFS data service package, on a cluster. You can install specific data service packages from the Sun Cluster data service CD by using interactive scinstall, or you can install all data service packages on the CD by using the -s option to non-interactive scinstall. The preferred method is to use interactive scinstall, as described in the following procedure.

The data service packages might have been installed as part of your initial Sun Cluster installation. If not, use this procedure to install them now.

How to Install Sun Cluster HA for NFS Packages

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

  1. Load the data service CD into the CD-ROM drive.

  2. Run scinstall with no options.

    This command starts scinstall in interactive mode.

  3. Select the menu option: "Add support for new data service to this cluster node."

    You can then load software for as many data services as exist on the CD.

  4. Exit scinstall and unload the CD from the drive.

Where to Go from Here

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

Setting Up and Configuring Sun Cluster HA for NFS

To register and configure the Sun Cluster HA for NFS data service, use the Cluster Module of Sun Management Center or the following command-line procedure.

Before you set up and configure Sun Cluster HA for NFS, use 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 node in the cluster.

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


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

    Use the Pathprefix standard property to specify a directory to be used for administrative files.


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

    Note -

    admin-dir must be a cluster file system. You must create it yourself.


    -a -g resource-group

    Adds the named failover resource group.

    -y Pathprefix=path

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

  4. Verify that all logical host names that you will be using have been added to your name service database.

    You should have done this verification as part of the Sun Cluster installation. For details on this step, see the planning chapter in the Sun Cluster 3.0 Installation Guide.


    Note -

    To avoid any failures because of name service lookup, verify that all logical host names are present in the server's and client's /etc/hosts file. Configure name service mapping in /etc/nsswitch.conf 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 host names.


  5. Add the desired logical host name resources into the failover resource group.

    You must set up a LogicalHostname resource with this step. The host name used with Sun Cluster HA for NFS cannot be a SharedAddress resource.


    # scrgadm -a -L -g resource-group-name -l hostname, ...
    
    -a -L -g resource-group-name

    Specifies the failover resource group into which to place the logical host name resources.

    -l hostname, ...

    Specifies the network resources (logical host names) to be added.

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

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


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

    For example, create Pathprefix/SUNW.nfs/dfstab.resource-name, 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 you are planning to create (in Step 9). A good resource name would refer to the task 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 you have created to be shared. The format of this file is exactly the same as the format used in /etc/dfs/dfstab.


    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. For Sun Cluster, rw is recommended. 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 host names used by Sun Cluster, and enables Sun Cluster HA for NFS fault monitoring to operate most efficiently. For details, see dfstab(4), share(1M), and share_nfs(1M).

    If you specify a client list in the share command, include all physical and logical host names that are associated with the cluster, as well as the host names 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 host names to the appropriate net group.


    Note -

    Do not grant access to the host names 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. In this case, Sun Cluster HA for NFS fault monitoring can still perform monitoring without having write access.


    Note -

    When constructing share options, avoid using the root option and avoid mixing ro and rw options.


  8. Register the NFS resource type.


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

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

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


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

    Adds a resource.

    -j resource-name

    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-name

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

    -t resource-type-name

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

  10. Enable the resource and the resource monitor, manage the resource group, and switch the resource group into the online state.


    # scswitch -Z -g resource-group-name
    

Example-Setting Up and Configuring Sun Cluster HA for NFS

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


(Create a logical host resource group and specify the path to the administrative files used by NFS (Pathprefix).)
# scrgadm -a -g lh-schost-1 -y Pathprefix=/global/nfs
 
(Add logical hostname resources into the logical host resource group.)
# scrgadm -a -L -g lh-schost-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-name 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 lh-schost-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 lh-schost-1

Where to Go from Here

If you need to set share options for your NFS file systems, refer to "How to Change Share Options on an NFS File System". If you want to review or set extension properties, refer to "Configuring Sun Cluster HA for NFS 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 host names to the appropriate netgroup. Ideally, grant both read and write access to all the Sun Cluster host names 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-name
    
    -M

    Disables the resource monitor.

  3. Execute your proposed new share(1M) command.

    Before editing the dfstab.resource-name file with new share options, execute the new share(1M) command to verify that the combination of options is valid.


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

    Identifies the file system type as NFS.

    -o specific_options

    Specifies an option. We suggest 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(1M) command fails, immediately execute another share(1M) command with the old options. When the new command executes successfully, go on to the next step.

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

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

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


    # unshare [-F nfs] [-o rw] pathname
    # vi dfstab.resource-name
    
    -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-name 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-name
    

How to Tune Sun Cluster HA NFS Method Timeouts

The time HA NFS methods take to finish depends on the number of paths shared by the resources through the dfstab.resource-name file. The default timeout for these methods is 300 seconds. A simple rule of thumb is to allocate 10 seconds toward the method timeout 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-name file contains 50 shared paths, the recommended timeout is 500 seconds.

The method timeouts that you should change are:

Prenet_start_timeoutPostnet_stop_timeoutMonitor_Start_timeout
Start_timeoutValidate_timeoutMonitor_Stop_timeout
Stop_timeoutUpdate_timeoutMonitor_Check_timeout

To change method timeouts, use the scrgadm(1M) -c option. For example:


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

How to Configure SUNW.HAStorage Resource Type

The SUNW.HAStorage resource type synchronizes actions between HA storage and data service. Because Sun Cluster HA for NFS is disk-intensive, we strongly recommend that you set up SUNW.HAStorage.

For details on the background, see the SUNW.HAStorage(5) man page and "Relationship Between Resource Groups and Disk Device Groups". For the procedure, see "How to Set Up SUNW.HAStorage Resource Type for New Resources".

Configuring Sun Cluster HA for NFS Extension Properties

You are not required to set any extension properties for Sun Cluster HA for NFS.

See Appendix A, Standard Properties for details of all Sun Cluster properties.

How to Configure Sun Cluster HA for NFS Extension Properties

Typically, you configure extension properties by using the Cluster Module of Sun Management Center or the command line scrgadm -x parameter=value at the time you create the NFS resource. You can also configure them later by using the procedures described in Chapter 9, Administering Data Service Resources.

Table 7-2 describes extension properties you can configure for Sun Cluster HA for NFS. Some extension properties can be updated dynamically, others only when the resource is created. The Tunable column indicates when the property can be updated.

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 the fault monitor is to be restarted by the process monitor facility during the time window specified by the Monitor_retry_interval property. Note that this property refers to restarts of the fault monitor itself, rather than to the resource. Restarts of the resource are controlled by the system defined properties Retry_interval, and Retry_count. See the scrgadm man page for a description of these properties.

Monitor_retry_interval (integer)

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 the fault monitor fails is more than the value specified in the extension property Monitor_retry_count within this period, the fault monitor is not restarted by the process monitor facility.

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