We have a requirement to access Apache Ranger audit data from a non-HDFS host. Our ranger setup uses elastic for the live data and this is archived to HDFS on the same cluster. The non-HDFS node is in the same subnet but is not HDFS-aware.
I read through the Apache documentation for Hadoop and, specifically, the part for setting up NFS gateway.
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html
What I do not understand about this is that it is using standard NFS commands on the NFS server but nowhere does it indicate how that relates to HDFS access. NFS reads the /etc/exports list but HDFS files and directories will not be accessible as standard Unix files. So I cannot see how any exports list will contain meaningful configuration data - even though the docs do not mention editing this file anyway.
For this core-site config I used the existing hdfs superuser and the hosts are just *
<property>
<name>hadoop.proxyuser.nfsserver.groups</name>
<value>root,users-group1,users-group2</value>
<description>
The 'nfsserver' user is allowed to proxy all members of the 'users-group1' and
'users-group2' groups. Note that in most cases you will need to include the
group "root" because the user "root" (which usually belonges to "root" group) will
generally be the user that initially executes the mount on the NFS client system.
Set this to '*' to allow nfsserver user to proxy any group.
</description>
</property>
<property>
<name>hadoop.proxyuser.nfsserver.hosts</name>
<value>nfs-client-host1.com</value>
<description>
This is the host where the nfs gateway is running. Set this to '*' to allow
requests from any hosts to be proxied.
</description>
</property>
So our proxyuser exists already (default names: hue, hive, flink, etc)
<property>
<name>hadoop.proxyuser.hdfs.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hdfs.hosts</name>
<value>*</value>
</property>
For the hdfs-site.xml config, I added
<property>
<name>nfs.exports.allowed.hosts</name>
<value>* rw</value>
</property>
<property>
<name>nfs.superuser</name>
<value>hdfs</value>
</property>
<property>
<name>nfs.export.point</name>
<value>/ranger</value>
</property>
So for that specific ranger data I would have to use hdfs dfs -ls /ranger but, for Linux, this is contained somewhere on various datanodes as /mnt/dataxx/dn/current/blah/something.
I don't understand how showmount would work for HDFS.
For a command of : mount -t nfs -o vers=3,proto=tcp,nolock,noacl,sync nfsserver:/ /mnt/ranger-data
On the NFS server the remote mount generates:-
rpc.mountd: refused mount request from <client> for / (/): unmatched host
and on the client we see:-
mount.nfs: access denied by server while mounting nfsserver:/