Setting Up Aliases for NFS Exports

About this task

When provisioning file system for various tenants, you can set up an alias for the path in file system, rather than exporting the whole path, to mask the path from the users. Once the alias is set up, users will not be able to access or mount the path in file system.

Aliases can be set up for the cluster, volume, and directory, but not for the root of the path in file system (/mapr). To set up an alias for a path in file system:

Procedure

  1. Open the NFS exports file in /opt/mapr/conf/ directory.
  2. Specify the alias name for the mount path using the following syntax:
    <path in MFS> /<alias name> <options>
    Here:
    <path in MFS> Refers to the file system mount path. If this points to a:
    • Volume, the user can access the snapshots associated with the volume.
    • Directory, the user cannot access the snapshots.
    /<alias name> Refers to the alias name to use. If there are duplicate aliases in the file, the last entry will take effect and all other duplicate entries will be ignored. If the alias name is not specified, the path in file system will be exported.
    <options> The list of available/supported options.
    For example, suppose a file system mount path of /mapr/samplecluster/samplevolume for tenant samplecustomer. To set up an alias, add the following to the exports file:
    /mapr/samplecluster/samplevolume /samplecustomer (rw)
    For example, to export a certain cluster, volume, or a subdirectory as an alias, comment out /mapr and add the following:
    /mapr/clustername /alias1 (rw)
    /mapr/clustername/vol /alias2 (rw)
    /mapr/clustername/vol/dir /alias3 (rw)
    NOTE Only the alias will be visible/exposed to the NFS client.
  3. Run the following command for the file changes to take effect:
    /opt/mapr/bin/maprcli nfsmgmt refreshexports
  4. Run the following command to export the path:
    mount -t nfs nfsServer:/<alias_name> /localpath
    Run this command once for each entry in the file.

What to do next

The same export rules must be set up on all the NFS servers in the cluster to ensure that in the event of a node failure, the same aliases work with VIP failover.