我对HDFS资源有一个护林员政策,看起来像...
现在尝试以两个不同的用户身份通过hadoop fs <path to the hdfs location>
访问该HDFS路径:
# as an unauthorized user
[ml1@HW04 ml1c]$ hadoop fs -ls <path to the hdfs location>
ls: Permission denied: user=ml1, access=EXECUTE, inode="<path to the hdfs location>"
# as an authorized user
[hph_etl@HW04 hph_etl]$ hadoop fs -ls <path to the hdfs location>
Found 4 items
drwxrwxr-x - hph_etl hph_etl 0 2019-07-31 15:13 <path to the hdfs location>
drwxrwxr-x - hph_etl hph_etl 0 2019-08-07 10:52 <path to the hdfs location>
drwxrwxr-x - hph_etl hph_etl 0 2019-07-31 14:28 <path to the hdfs location>
drwxrwxr-x - hph_etl hph_etl 0 2019-07-26 16:12 <path to the hdfs location>
可正常使用。现在,通过本地文件系统上的ls -lh <nfs path to the hdfs location>
进行尝试:
# as an unauthorized user
[ml1@HW04 ml1c]$ ls -lh <nfs path to the hdfs location>
total 2.0K
drwxrwxr-x. 4 hph_etl hph_etl 128 Jul 31 15:13 export
drwxrwxr-x. 5 hph_etl hph_etl 160 Aug 7 10:52 import
drwxrwxr-x. 5 hph_etl hph_etl 160 Jul 31 14:28 storage
drwxrwxr-x. 3 hph_etl hph_etl 96 Jul 26 16:12 tests
# as an authorized user
[hph_etl@HW04 hph_etl]$ ls -lh <nfs path to the hdfs location>
total 2.0K
drwxrwxr-x. 4 hph_etl hph_etl 128 Jul 31 15:13 export
drwxrwxr-x. 5 hph_etl hph_etl 160 Aug 7 10:52 import
drwxrwxr-x. 5 hph_etl hph_etl 160 Jul 31 14:28 storage
drwxrwxr-x. 3 hph_etl hph_etl 96 Jul 26 16:12 tests
我们看到两个用户都可以通过NFS访问HDFS位置(即使只有hph_etl
用户也可以)。有人知道这是怎么回事吗?有调试提示或修复程序吗?
更新:
显然,这不是意外行为。与Hortonworks的人员交谈,目的是...
对我来说,这似乎是一个安全问题,因为我可以轻松地执行此类操作
$ cd /hdfs_nfs_mount/some/private/location
$ head some_private_file.txt
<shows all the contents>
# even when Ranger would rather this user not go there...
$ whoami
<some unauthorized user>
$ hadoop fs -ls /some/private/location
ls: Permission denied: user=<some unauthorized user>, access=EXECUTE, inode="/some/private/location"
如果在仅将所有HDFS安装到HDFS根服务器上的常规群集节点上。不要写这个作为答案,因为有点希望这不是答案。将继续寻找。
答案 0 :(得分:0)
显然,这不是意外行为。与Hortonworks的人交谈,目的是...
通过具有基于POSIX限制的权限的NFS将HDFS的特定部分安装到计算机上 然后让NiFi(例如来自HDF)不断监听这些位置,然后将数据加载到HDFS中其他受Ranger保护的位置 对我来说,这似乎是一个安全问题,因为我可以轻松地执行类似的操作
$ cd /hdfs_nfs_mount/some/private/location
$ head some_private_file.txt
<shows all the contents>
# even when Ranger would rather this user not go there...
$ whoami
<some unauthorized user>
$ hadoop fs -ls /some/private/location
ls: Permission denied: user=<some unauthorized user>, access=EXECUTE, inode="/some/private/location"
如果在仅将所有HDFS都安装到HDFS根服务器上的常规群集节点上。
似乎使用NFS的常规方法是...
因此, HDFS NFS网关不是读取文件或浏览HDFS的理想选择。为此,建议在Ambari中为各种cluster users使用创建用户帐户,并授予他们访问FileViews的权限以浏览和下载文件(将受Ranger策略保护) )。