Sun Cluster 2.2 Software Installation Guide

Sharing NFS File Systems

This section describes the procedures used to set up file systems to be shared by NFS by editing the logical host's dfstab.logicalhost files.


Note -

Before you set up file systems to be shared by NFS, make sure you have configured your logical hosts. When you first configure the cluster, you provide the scinstall(1M) command with information about your logical host configuration. Once the cluster is up, you can configure logical hosts by running either the scinstall(1M) or scconf(1M) commands.


How to Share NFS File Systems

Note -

NFS file systems are not shared until you perform a cluster reconfiguration as outlined in "How to Register and Activate NFS".


  1. Create the multihost file systems.

    Use the procedures described in Appendix B, Configuring Solstice DiskSuite, and in Appendix C, Configuring VERITAS Volume Manager, to create the multihost file systems.

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

  3. From a cconsole(1) window, use an editor such as vi to create and edit the /etc/opt/SUNWcluster/conf/hanfs/dfstab.logicalhost file.

    By using a cconsole(1) window, you can make changes on all the potential masters of these file systems. You can also update dfstab.logicalhost on one node and use rcp(1) to copy it to all other cluster nodes that are potential masters of the file systems. Add entries for all files systems created in Step 1 that will be shared.

    The dfstab.logicalhost file is in dfstab format. The file contains share(1M) commands in this syntax.


    share [-F fstype] [-o options] [-d "<text>"] <pathname> [resource]

    If you use the rw, rw=, ro, or ro= options to the share -o command, grant access to all hostnames that Sun Cluster uses. This enables Sun Cluster HA for NFS fault monitoring to operate most efficiently. Include all physical and logical hostnames that are associated with the Sun Cluster, as well as the hostnames on all public networks to which the Sun Cluster is connected.

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


    Note -

    Do not grant access to the hostnames on the private nets.


    Grant read and write access to all the hosts' hostnames, to enable the HA-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 will still be able to perform monitoring without having write access.

    The resulting file will look similar to this example, which shows the logical host name (hahost1), the file system type (nfs), and the mount point names (/hahost1/1 and /hahost1/2).


    share  -F nfs  -d "hahost1 fs 1" /hahost1/1
    share  -F nfs  -d "hahost1 fs 2" /hahost1/2


    Note -

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


  4. (Optional) Create the file .probe_nfs_file in each directory to be NFS-shared.

    For enhanced fault monitoring, each directory exported by Sun Cluster HA for NFS (that is, each directory listed in the dfstab files for Sun Cluster HA for NFS) should contain the file .probe_nfs_file. For each such directory, cd to the directory and create the file using the touch(1) command:

    Do this on the physical host that currently masters the logical host for that dfstab file.


    phys-hahost1# touch .probe_nfs_file 
    

After completing these steps, register and activate NFS using the procedure "How to Register and Activate NFS".

How to Register and Activate NFS

After setting up and configuring NFS, you must activate Sun Cluster HA for NFS by using the hareg(1M) command to start the Sun Cluster monitor.

  1. Register Sun Cluster HA for NFS.

    Use the hareg(1M) command to register the Sun Cluster HA for NFS data service on all hosts in the Sun Cluster. Run the command on only one node.


    # hareg -s -r nfs
    

    The following command registers the Sun Cluster HA for NFS data service only on logical hosts hahost1 and hahost2. Run the command on only one node.


    # hareg -s -r nfs -h hahost1,hahost2
    

  2. Activate the NFS service by invoking the hareg(1M) command on one host.


    # hareg -y nfs
    

  3. Execute a membership reconfiguration.


    # haswitch -r
    

    Refer to the Sun Cluster 2.2 System Administration Guide for more information on forcing a cluster reconfiguration.

The process of setting up, registering, and activating Sun Cluster HA for NFS on your Sun Cluster servers is now complete.

How to Add NFS to a System Already Running Sun Cluster
  1. Create and edit the /etc/opt/SUNWcluster/conf/hanfs/dfstab.logicalhost file.

    Follow the instructions in "How to Share NFS File Systems" to edit the dfstab file.

  2. Register and activate NFS.

    Follow the instructions in "How to Register and Activate NFS".