Configure the NFS Gateway

You must ensure that the proxy user for the NFS Gateway can proxy all the users accessing the NFS mounts. In addition, you must configure settings specific to the Gateway.

  1. Ensure that the proxy user for the NFS Gateway can proxy all the users accessing the NFS mounts.
    In non-secure mode, the user running the Gateway is the proxy user, while in secure mode the user in Kerberos keytab is the proxy user.
    If a user nfsserver is running the Gateway and there are users belonging to groups nfs-users1 and nfs-users2, then set the following values in core-site.xml on the NameNode.
    1. Set the value of the hadoop.proxyuser.nfsserver.groups property in NFS Gateway Advanced Configuration Snippet (Safety Valve) for hdfs-site.xml.
      For example, nfs-users1,nfs-users2. The nfsserver user is allowed to proxy all members of the nfs-users1 and nfs-users2 groups. Set this to * to allow nfsserver user to proxy any group.
    2. Set the value of the hadoop.proxyuser.nfsserver.hosts property in NFS Gateway Advanced Configuration Snippet (Safety Valve) for hdfs-site.xml.
      For example, nfs-client-host1.com is the host where the NFS Gateway is running. Set this to * to allow requests from any hosts to be proxied.
  2. Configure settings for the NFS Gateway.
    The NFS Gateway uses the same settings that are used by the NameNode and DataNode. Configure various properties based on your application's requirements:
    1. In the Cloudera Manager Admin Console, go to Clusters > HDFS service.
    2. Navigate to the Configurations tab and search for the Access Time Precision property.
    3. Specify the access time precision. For example, 1 hour.
    4. Search for the Temporary Dump Directory property, and set the value as /tmp/.hdfs-nfs.
    5. Search for the Allowed Hosts and Privileges property, and set the value as * rw.
    6. Restart the NFS Gateway.
    7. Optional: Customize log settings by modifying the log4j.property file.
      • To change the trace level, go to Configuration > NFS Gateway Logging Advanced Configuration Snippet (Safety Valve), and add log4j.logger.org.apache.hadoop.hdfs.nfs=DEBUG
      • To view more information about ONCRPC requests, go to Configuration > NFS Gateway Logging Advanced Configuration Snippet (Safety Valve), and add log4j.logger.org.apache.hadoop.oncrpc=DEBUG
  3. Specify JVM heap space (HADOOP_NFS3_OPTS) for the NFS Gateway.
    You can increase the JVM heap allocation for the NFS Gateway using this option. To set this option, go to Configuration > Java Heap Size of NFS Gateway in Bytes, and enter the value.
  4. To improve the performance of large file transfers, you can increase the values of the dfs.nfs.rtmax and dfs.nfs.wtmax properties.
    These properties are configuration settings on the NFS Gateway server that change the maximum read and write request size supported by the Gateway. The default value for both settings is 1MB.