Adding additional options for the "nfsserver" Pacemaker Resource

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 6, 7, and 8 with High-Availability or Resilient Storage Add-on
  • Pacemaker cluster
  • ocf:heartbeat:nfsserver Resource Agent

Issue

  • Can additional options be added to the /etc/sysconfig/nfs or /etc/nfs.conf files while using the nfsserver resource agent?
  • Options included in /etc/sysconfig/nfs are overwritten when the nfsserver resource agent starts within a cluster.

Resolution

When the nfsserver resource agent starts up it will overwrite all existing configurations under /etc/sysconfig/nfs with options passed into the resource. For this reason, many of the options under the /etc/sysconfig/nfs are inaccessible by the resource agent, and only specific options can be modified. Many of the available options from /etc/sysconfig/nfs are additionally available in /etc/nfs.conf or other ".conf" files with different names. Equivalent configuration is needed for any options not provided by the resource agent.

Below we discuss the options that are available to the nfsserver resource agent for modification of the auto-generated /etc/sysconfig/nfs file or equivalent options available in other configuration files. Any configuration changes made under /etc/nfs.conf or other configuration files will need to be manually propagated across all nodes:

"RPCNFSDARGS"

The nfsd_args option can be used to update the RPCNFSDARGS field in the auto-generated /etc/sysconfig/nfs file:

$ pcs resource describe nfsserver
------------------------------------------>8----------------------------------------
Resource options:
------------------------------------------>8----------------------------------------
  nfsd_args: Specifies what arguments to pass to the nfs daemon on startup. View the rpc.nfsd man page for information on what arguments are
             available. Note that setting this value will override all settings placed in the local /etc/sysconfig/nfs file.

Example:

# To add "RPCNFSDARGS" options:
$ pcs resource update nfs-daemon nfsd_args="-N 2 -V 3 -V 4"
$ cat /etc/sysconfig/nfs
# AUTOGENERATED by /usr/lib/ocf/resource.d/heartbeat/nfsserver high availability resource-agent
# local config backup stored here, '/etc/sysconfig/nfs.ha.bu'
------------------------------------------>8----------------------------------------
# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8)
RPCNFSDARGS="-N 2 -V 3 -V 4"

"RPCMOUNTDOPTS"

Comparable options for "mountd" in "/etc/nfs.conf":

The man pages for nfs.conf can be referenced for comparable options to those available for RPCMOUNTDOPTS in /etc/sysconfig/nfs:

$ man nfs.conf
------------------------------------------>8----------------------------------------
       mountd Recognized values: manage-gids, descriptors, port, threads, reverse-lookup, state-directory-path, ha-callout.

              These,  together  with  the protocol and version values in the [nfsd] section, are used to configure mountd. 
               See rpc.mountd(8) for details.

"STATDARG"

Comparable options for "statd" in "/etc/nfs.conf":

The man pages for nfs.conf can be referenced for comparable options to those available for STATDARG in /etc/sysconfig/nfs:

$ man nfs.conf
------------------------------------------>8----------------------------------------
       statd  Recognized values: port, outgoing-port, name, state-directory-path, ha-callout.

              See rpc.statd(8) for details.

"SMNOTIFYARGS"

Comparable options for "sm-notify" in "/etc/nfs.conf":

The man pages for nfs.conf can be referenced for comparable options to those available for SMNOTIFYARGS in /etc/sysconfig/nfs:

$ man nfs.conf
------------------------------------------>8----------------------------------------
       sm-notify
              Recognized values: retry-time, outgoing-port, and outgoing-addr.

              See sm-notify(8) for details.

"RPCIDMAPDARGS"

Comparable options for "rpc.idmapd" in "/etc/idmapd.conf":

The man pages for idmapd.conf can be referenced for comparable options to those available for RPCIDMAPDARGS in /etc/sysconfig/nfs and settings updated under /etc/idmapd.conf should have similar effects without being overwritten :

$ man idmapd.conf
------------------------------------------>8----------------------------------------
   [General] section variables
       Verbosity
              Verbosity level of debugging (Default: 0)

       Domain The local NFSv4 domain name.  An NFSv4 domain is a namespace with a unique username<->UID
              and groupname<->GID  mapping.   (Default: Host's fully-qualified DNS domain name)
...
....
   [Mapping] section variables
       Nobody-User
              Local user name to be used when a mapping cannot be completed.

       Nobody-Group
              Local group name to be used when a mapping cannot be completed.
...

"RPCGSSDARGS"

Comparable options for "rpc.gssd" in "/etc/nfs.conf":

The man pages for nfs.conf can be referenced for comparable options to those available for RPCGSSDARGS in /etc/sysconfig/nfs:

$ man nfs.conf
------------------------------------------>8----------------------------------------
       gssd   Recognized values: verbosity, rpc-verbosity, use-memcache, use-machine-creds, avoid-dns,
              limit-to-legacy-enctypes, context-timeout, rpc-timeout, keytab-file, cred-cache-directory, preferred-realm.

              See rpc.gssd(8) for details.

"GSS_USE_PROXY"

There are no comparable options in any of the existing configuration files or the nfsserver resource agent. This value will automatically default to "yes" based on nfs-utils configuration.

"BLKMAPDARGS"

Comparable options for "blkmapd" in "/etc/nfs.conf":

The man pages for nfs.conf can be referenced for comparable options to those available for BLKMAPDARGS in /etc/sysconfig/nfs. There is only one option available here for pipefs-directory and this should be placed in the [general] section of nfs.conf.

$ man nfs.conf
------------------------------------------>8----------------------------------------
       general
              Recognized values: pipefs-directory.

              See blkmapd(8), rpc.idmapd(8), and rpc.gssd(8) for details.

Root Cause

Clustered resources are meant to be managed by Pacemaker and its resource agents in order to avoid conflicts with running the service on several nodes at the same time, and to ensure that the services come up with the exact same options no matter what node is in use. Due to this the /usr/lib/ocf/lib/heartbeat/nfsserver-redhat.sh script exist to update the /etc/syconfig/nfs file with common configurations that will be applied to whatever server is active and overwriting any existing configuration files there.

SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.