Oracle® Solaris Cluster Data Service for Network File System (NFS) Guide

Exit Print View

Updated: July 2014, E39653–01
 
 

How to Set Up the HAStoragePlus Resource Type for an NFS-Exported ZFS

The following procedure uses a simple NFS service.

See Creating a Basic ZFS Storage Pool in Managing ZFS File Systems in Oracle Solaris 11.2 for information about how to create a ZFS pool. See Creating a ZFS File System Hierarchy in Managing ZFS File Systems in Oracle Solaris 11.2 for information about how to create a ZFS file system in that ZFS pool.

  1. On a cluster node, assume the root role 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 list
  3. If necessary, register the HAStoragePlus resource type and the SUNW.nfs resource type.
    # clresourcetype register SUNW.HAStoragePlus SUNW.nfs
  4. Create the failover resource group.
    # clresourcegroup create -p PathPrefix=path resource-group
  5. Create a logical host resource of type SUNW.LogicalHostname.
    # clreslogicalhostname create -g resource-group \
    -h logical-hostname logicalhost-resource

    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 ZFS file system resource of type HAStoragePlus.
    # clresource create -g resource-group -t SUNW.HAStoragePlus \
    -p Zpools=zpool HASP-resource

    The resource is created in the enabled state.


    Note -  You can specify a list of one or more ZFS pools for the Zpools extension property.
  7. Bring online the resource group on a cluster node in a managed state.

    The node on which the resource group is brought online becomes the primary node for the ZFS file system. The ZFS pool zpool is imported on this node. The ZFS file system is consequently mounted locally on this node.

    # clresourcegroup online -M resource-group
  8. Create the resource of type SUNW.nfs and specify its resource dependency on the resource of type SUNW.HAStoragePlus.

    The file dfstab.nfs-rs must be present in zpool/nfs/SUNW.nfs.

    # clresource create -g resource-group -t SUNW.nfs \
    -p resource_dependencies_offline_restart=HASP-resource NFS-resource

    The resource is created in the enabled state.


    Note -  Before you can set the dependency in the NFS-resource resource, the HASP-resource resource must be online.
  9. Bring online the resource-group group on a cluster node in a managed state.
    # clresourcegroup online -M resource-group
Example 1-2  Setting Up the HAStoragePlus Resource Type for an NFS-Exported ZFS File System

The following example uses a simple NFS service. The example assumes the following:

  • The nfs/export directory exists in the ZFS pool /nfszpool.

  • The dfstab.resource file exists in the /nfszpool/nfs/SUNW.nfs directory.

  • The path-prefix directory is on the root directory of the same file system that is to be mounted, for example, /nfszpool/nfs. The path-prefix directory is the directory that HA-NFS uses to maintain administrative information and status information.

phys-schost-1% su
Password: 
# clresourcetype list
SUNW.LogicalHostname:2
SUNW.SharedAddress:2
# clresourcetype register SUNW.HAStoragePlus SUNW.nfs
# clresourcegroup create -p PathPrefix=/nfszpool/nfs nfs-rg
# clreslogicalhostname create -g nfs-rg -h log-nfs nfs-lh-rs
# clresource create -g nfs-rg -t SUNW.HAStoragePlus \
  -p Zpools=nfszpool nfs-hastp-rs
# clresourcegroup online -M nfs-rg
# clresource create -g nfs-rg -t SUNW.nfs \
  -p resource_dependencies_offline_restart=nfs-hastp-rs nfs-rs