Setting Up Aliases for NFS Exports

When provisioning MapR Filesystem for various tenants, you can set up an alias for the path in MapR Filesystem, 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 MapR Filesystem.

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

  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 MapR Filesystem 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 MapR Filesystem will be exported.
    <options> The list of available/supported options.
    For example, suppose a MapR Filesystem 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.
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.