Sun Cluster Data Service for NFS Guide for Solaris OS

ProcedureHow to Set Up the HAStoragePlus Resource Type for an NFS-Exported Unix File System Using the Command Line Interface

The HAStoragePlus resource type performs the same functions as HAStorage, and synchronizes the startups between resource groups and disk device groups. The HAStoragePlus resource type has an additional feature to make a local file system highly available. For background information about making a local file system highly available, see Enabling Highly Available Local File Systems in Sun Cluster Data Services Planning and Administration Guide for Solaris OS. To use both of these features, set up the HAStoragePlus resource type.

Note –

These instructions explain how to use the HAStoragePlus resource type with the UNIX file system (UFS). For information about using the HAStoragePlus resource type with the Sun StorEdgeTM QFS file system, see your Sun StorEdge QFS documentation.

The following example uses a simple NFS service that exports home directory data from a locally mounted directory /global/local-fs/nfs/export/ home. The example assumes the following:

  1. On a cluster node, become superuser or assume a role that provides solaris.cluster.modify RBAC authorization.

  2. Determine whether the HAStoragePlus resource type and the SUNW.nfs resource type are registered.

    The following command prints a list of registered resource types.

    # clresourcetype show | egrep Type
  3. If necessary, register the HAStoragePlus resource type and the SUNW.nfs resource type.

    # clresourcetype register SUNW.HAStoragePlus
    # clresourcetype register SUNW.nfs
  4. Create the failover resource group nfs-rg.

    # clresourcegroup create -p PathPrefix=/global/local-fs/nfs nfs-rg
  5. Create a logical host resource of type SUNW.LogicalHostname.

    # clreslogicalhostname create -g nfs-rg -L -h log-nfs nfs-lh-rs

    Note –

    If you require a fully qualified hostname, you must specify the fully qualified name with the -h option and you cannot use the fully qualified form in the resource name.

  6. Create the resource nfs-hastp-rs of type HAStoragePlus.

    # clresource create -g nfs-rg -t SUNW.HAStoragePlus \
    -p FilesystemMountPoints=/global/local-fs/nfs \
    -p AffinityOn=True nfs-hastp-rs

    The resource is created in the enabled state.

    Note –

    You can use the FilesystemMountPoints extension property to specify a list of one or more mount points for file systems. This list can consist of mount points for both local file systems and global file systems. The mount at boot flag is ignored by HAStoragePlus for global file systems.

  7. Bring online the resource group nfs-rg on a cluster node.

    The node or zone where the resource group is brought online becomes the primary node for the /global/local-fs/nfs file system's underlying global device partition. The file system /global/local-fs/nfs is then mounted on this node or zone.

    # clresourcegroup online -M nfs-rg
  8. Create the resource nfs-rs of type SUNW.nfs and specify its resource dependency on the resource nfs-hastp-rs.

    The file dfstab.nfs-rs must be present in /global/local-fs/nfs/SUNW.nfs.

    # clresource create -g nfs-rg -t SUNW.nfs \
    -p Resource_dependencies=nfs-hastp-rs nfs-rs

    The resource is created in the enabled state.

    Note –

    Before you can set the dependency in the nfs-rs resource, the nfs-hastp-rs resource must be online.

  9. Take offline the resource group nfs-rg.

    # clresourcegroup offline nfs-rg
  10. Bring online the nfs-rg group on a cluster node or zone.

    # clresourcegroup online -M nfs-rg

    Caution – Caution –

    Ensure that you switch only the resource group. Do not attempt to switch the device group. If you attempt to switch the device group, the states of the resource group and the device group become inconsistent, causing the resource group to fail over.

    Whenever the service is migrated to a new node, the primary I/O path for /global/local-fs/nfs will always be online and colocated with the NFS servers. The file system /global/local-fs/nfs is locally mounted before the NFS server is started.