Sun Cluster 3.0 Data Services Installation and Configuration Guide

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".