Chapter 3. Adding NFS to the Cluster Database

This chapter discusses the tasks required to add NFS to the FailSafe cluster database. The major sections in this chapter are as follows:

These procedures assume that the FailSafe cluster database has already been created, installed, and tested as described in the IRIS FailSafe Version 2 Administrator's Guide.

To verify hat the NFS and statd_unlimited resources have been correctly configured, see Chapter 4, “Testing the Resources”.

Installing the NFS and statd_unlimited Resource Types

If you have the FailSafe NFS software installed before you create a FailSafe cluster, the NFS and statd_unlimited resource types will be automatically installed at cluster creation time. However, if you already have a cluster created before you install the FailSafe NFS software, you must manually install the resource types.

To determine if the resource types have been installed, enter the following cmgr(1M) command:

show resource_types in cluster clustername

For example, the following output shows that the resource types are not present:

cmgr> show resource_types in cluster nfscluster
template
Netscape_web
Oracle_DB
MAC_address
IP_address
INFORMIX_DB
filesystem
volume

You can also display this information by selecting View: Types in the FailSafe GUI.

To install the resource types, use the following cmgr command:

install resource_type ResourceTypename in cluster Clustername

For example, to install the NFS resource type in a cluster named nfscluster, enter the following cmgr command:

cmgr> install resource_type NFS in cluster nfscluster

To do this in the GUI, use the following menu selection and choose the name of the resource type:

Tasks -> Resource Types -> Load a Resource Type


Note: As of FailSafe NFS 2.2, the start executable timeout has been increased to 50 seconds. If you are upgrading from a FailSafe NFS 2.1 or earlier, you may want to increase the start executable timeout for the statd_unlimited resource type by using the Modify a Resource Type task the FailSafe GUI or the modify resource_type operation in the cmgr command. In FailSafe 2.2, the recovery for NFS locks will take at most 30 seconds, even when NFS clients are not responding.

For example, for a cluster named mycluster:
cmgr> modify resource_type statd_unlimited in cluster mycluster
Enter commands, when finished enter either "done" or "cancel"

resource_type statd_unlimited ? modify action start
Enter action parameters, when finished enter "done" or "cancel"

Current action start parameters:
        exec_time : 40000ms
        monitor_interval : 0ms
        monitor_time : 0ms

Action - start ? set exec_time to 50000
Action - start ? done
resource_type statd_unlimited ? done
Successfully modified resource_type statd_unlimited



Defining Resources

You can use the FailSafe GUI or the cmgr(1M) command to define specific instances of NFS and statd_unlimited resources. You must provide a name for each resource and information about any type-specific attributes; the resource name can be a maximum length of 255 characters and cannot begin with an underscore. For more information about using the GUI or cmgr , see the IRIS FailSafe Version 2 Administrator's Guide.

If there are more than 50 clients mounting the NFS filesystem, the NFS lock recovery for the filesystem will take longer. In such cases, you may have to increase the maximum execution time of the start action script for the statd_unlimited resource type.

NFS Attributes

The NFS resource name is the export-point; therefore, all standard IRIX directory name requirements must be followed.

You must define the following:

  • Export Information: Specifies the options for the filesystem used by the exportfs (1M) command. In cmgr, this is the export-info attribute.

    An exportfs(1M) command option that is a relevant to FailSafe NFS is specifying the filesystem ID ( fsid) for an exported filesystem. The fsid option specifies the value that will be returned in the fsid field of the attributes returned to the client. The value is an arbitrary number that must uniquely identify the exported filesystem. This option allows you to handle some Linux or other operating system NFS clients that are written to interpret or place restrictions on the fsid value returned in the attributes. If you use this option, you must use it for all exported filesystems and you must not use it in conjunction with the nohide option. This option only affects the fsid contained in the file attributes. File handles are constructed differently and do not use the fsid value in the file attributes.

    For more information about options, see the exports(4) man page.

  • Filesystem: Specifies the export disk name used as input to the exportfs(1M) command. In cmgr, this is the filesystem attribute.

statd_unlimited Attributes

The statd_unlimited resource specifies the NFS lock directory, which stores information about the NFS client locks. The statd_unlimited resource type requires the Export Point attribute, which specifies the NFS export point that corresponds to the NFS lock directory. In cmgr, this is the ExportPoint attribute.

Interactive cmgr Example

This example assumes that the highly available cluster named nfscluster and two resources (/shared1 and /shared2) of the filesystem resource type have been created in the cluster database.

node1# /usr/cluster/bin/cmgr
Welcome to IRIS FailSafe Cluster Manager Command-Line Interface

cmgr> set cluster nfscluster
cmgr> define resource /shared1 of resource_type NFS
Enter commands, when finished enter either "done" or "cancel"

Type specific attributes to create with set command:

Type Specific Attributes - 1: export-info
Type Specific Attributes - 2: filesystem

Resource type dependencies to add:

Resource Dependency Type - 1: filesystem

resource /shared1 ? set export-info to "rw,wsync,anon=root"
resource /shared1 ? set filesystem to /shared1
resource /shared1 ? add dependency /shared1 of type filesystem
resource /shared1 ? done
Successfully created resource /shared1

cmgr> define resource /shared1/statmon of resource_type statd_unlimited
Enter commands, when finished enter either "done" or "cancel"

Type specific attributes to create with set command:

Type Specific Attributes - 1: ExportPoint

Resource type dependencies to add:

Resource Dependency Type - 1: NFS

resource /shared1/statmon ? set ExportPoint to /shared1
resource /shared1/statmon ? add dependency /shared1 of type NFS
resource /shared1/statmon ? done
Successfully created resource /shared1/statmon

cmgr> show resource /shared1 of resource_type NFS
export-info: rw,wsync,anon=root
filesystem: /shared1

Resource dependencies
filesystem /shared1

cmgr> define resource /shared2 of resource_type NFS
Enter commands, when finished enter either "done" or "cancel"

Type specific attributes to create with set command:

Type Specific Attributes - 1: export-info
Type Specific Attributes - 2: filesystem

Resource type dependencies to add:

Resource Dependency Type - 1: filesystem

resource /shared2 ? set export-info to "rw,wsync,anon=root"
resource /shared2 ? set filesystem to /shared2
resource /shared2 ? add dependency /shared2 of type filesystem
resource /shared2 ? done
Successfully created resource /shared2

cmgr> define resource /shared2/statmon of resource_type statd_unlimited
Enter commands, when finished enter either "done" or "cancel"

Type specific attributes to create with set command:

Type Specific Attributes - 1: ExportPoint

Resource type dependencies to add:

Resource Dependency Type - 1: NFS

resource /shared2/statmon ? set ExportPoint to /shared2
resource /shared2/statmon ? add dependency /shared2 of type NFS
resource /shared2/statmon ? done
Successfully created resource /shared2/statmon

cmgr> show resource /shared2 of resource_type NFS
export-info: rw,wsync,anon=root
filesystem: /shared2

Resource dependencies
filesystem /shared2

cmgr> quit

node1#

Table 3-1 shows examples using the values as shown with the cmgr command; you can also set these values by using the FailSafe GUI.

Table 3-1. Example Resources and Attributes for the Resource Groups

Resource Type

Attribute

Dependency

Resource Group Stocks_rg

Resource Group Bonds_rg

filesystem

 

 

/shared1

/shared2

 

volume-name

 /shared1_vol/shared2_vol
 

mount-options

 rwrw
 

kill-nfsds-before-umount

 truetrue
 

monitoring-level

 22

IP_address

 

 

192.56.50.1

192.56.51.2

 

NetworkMask

 0xffffff000xffffff00
 

interfaces

 ef0ef0

NFS

 

 

/shared1

/shared2

 

export-info

 

rw,wsync,anon+root

rw,wsync,anon+root

 

filesystem

 

/shared1

/shared2

 

 

filesystem

/shared1

/shared2

statd_unlimited

 

 

/shared1/statmon

/shared2/statmon

 

ExportPoint

 

/shared1

/shared2

 

 

NFS

/shared1

/shared2

volume

 

 

shared1_vol

shared2_vol

 

devname-group

 syssys
 

devname_owner

 rootroot
 

devname_mode

 06000600

Creating a Resource Group

You can use the FailSafe GUI or the cmgr(1M) command to define a resource group. You must include all of the resources that the NFS resource is dependent on, such as filesystems, volumes, and IP addresses. An NFS resource should have a filesystem or a CXFS resource as a dependency.

The statd_unlimited resource is dependent upon the NFS resource. For more information about using the GUI or cmgr, see the IRIS FailSafe Version 2 Administrator's Guide.

The following example shows the creation of a typical resource group:

cmgr> create resource_group nfs1 in cluster nfscluster
Enter commands, when finished enter either "done" or "cancel"

resource_group nfs ? set failover_policy to ordered
resource_group nfs ? add resource /shared1 of resource_type NFS
resource_group nfs ? add resource 192.56.50.1 of resource_type IP_address
resource_group nfs ? add resource /shared1 of resource_type filesystem
resource_group nfs ? add resource shared1_vol of resource_type volume
resource_group nfs ? add resource /shared1/statmon of resource_type statd_unlimited


resource_group nfs ? done
Successfully created resource group nfs

cmgr> show resource_group nfs1 in cluster nfscluster

Resource Group: nfs1
        Cluster: nfscluster
        Failover Policy: ordered

Resources: 
        /shared1 (type: NFS)
        192.56.50.1 (type: IP_Addresses)
        /shared1 (type: filesystem)
        shared1_vol (type: volume)
        /shared1/statmon (type: statd_unlimited)

Changing Export Options

The /var/cluster/cmgr-scripts/change-export-options script lets you change export options for an NFS filesystem when the resource group containing the NFS resource is online. Use the following command line format:

change-export-options "ExportOptions" NFS-ExportPoint ResourceGroup [statd_unlimited_ResourceName]

If you use multiple export options, you must enclose them in double-quotation marks. If there are multiple statd_unlimited resources present in the resource group, you must also specify the statd_unlimited resource name.

For example, the following command line changes the export options for the /hafs NFS resource in the nfs-group resource group to be read-only, and specifies that the statd_unlimited resource to be used is /hafs/statmon :

# change-export-options "ro" /hafs nfs-group /hafs/statmon
Modifying NFS export option for /hafs in resource group nfs-group in cluster nfs-cluster
Putting resource group nfs-group in maintenance mode
Resume resource group nfs-group monitoring
change-export-options completed successfully