Reordering the file system location list using the scatter option

The scatter option of the exportfs command enables you to change the order of the locations specified in the file system location list that is set with either the refer option or the replicas option of the exportfs command.

Using this option generates different combinations of server locations so that different lists have different servers in the order of preference. Consequently, different clients have server location lists that are different. This reordering helps load balancing because the first server in the location list of different clients is a different server. Also, if a server goes down, the fail-over load is distributed across multiple servers because the server in the next location in the server locations list is different. The scatter option applies only to directories exported for access by the NFS version 4 protocol.

The scatter option can have the following values:
  • full - All of the servers are reordered to form combinations of alternate locations. The total number of combinations is limited to either 12 or the number of servers, whichever number is higher.
  • partial - The first location for all of the server combinations generated is fixed to the first server in the server list. The rest of the locations are listed as if a full reordering is used.
  • none - No reordering of the file system location list is done. This is the default value for the scatter option. Use this value to disable any previous reordering of the location list.
Note: If the noauto flag is not specified when you are using the exportfs command, then the location list includes the primary host name as one of the replica locations. For more information about the noauto flag, see the exportfs command in Commands Reference, Volume 2.
To specify referrals for the /common/documents directory at hosts s1, s2, and s3, and then reorder them using the full option, add the following line to the /etc/exports file and then export the /common/documents directory:
/common/documents -ver=4, refer=/common/documents@s1:/common/document@s2a:/common/
documents@s3,scatter=full
To specify replicas for the /common/documents directory at hosts s1, s2, s3, and s4, and reorder them partially (first fail-over server is s1 for all combinations), add the following line to the /etc/exports file and then export the /common/documents directory:
/common/documents -vers=4, replicas=/common/documents@s1:/common/documents@s2:/common/
   documents@s3:/common/documents@s4,scatter=partial