gpt4 book ai didi

linux - 无法写入 Hadoop DFS 目录模式 775 组权限 UserGroupInformation

转载 作者:可可西里 更新时间:2023-11-01 14:49:00 27 4
gpt4 key购买 nike

我在启用了文件系统权限的私有(private)集群上运行 Hadoop 2.6.2。集群有密码文件,只有像 hadoop 这样的系统用户,没有个人账户。我正在从具有像我这样的个人帐户('clott')的 linux 边缘节点访问 DFS。

问题是我无法写入模式为 775 和组 hadoop 的 DFS 目录(“共享”);边缘节点显示我是 hadoop 组的成员。我以为会使用边缘节点上的用户组成员资格,但是没有?这是我看到的:

clott@edge$ id
uid=1003(clott) gid=1003(clott) groups=1003(clott),27(sudo),1001(hadoop)

clott@edge$ hdfs dfs -ls /user/hadoop
Found 3 items
drwxr-xr-x - hadoop hadoop 0 2015-12-03 16:55 /user/hadoop/DistributedShell
drwxrwxr-x - hadoop hadoop 0 2015-12-22 09:25 /user/hadoop/shared

clott@edge$ hdfs dfs -mkdir /user/hadoop/shared/foo
mkdir: Permission denied: user=clott, access=WRITE, inode="/user/hadoop/shared":hadoop:hadoop:drwxrwxr-x

我检查了名称节点并在其日志中发现了这个警告:

2015-12-22 09:32:40,941 WARN org.apache.hadoop.security.UserGroupInformation: No groups available for user clott

这是有道理的 - 名称节点不授予我访问权限,因为它无法识别我的任何组。

那么名称节点是如何找到组成员的呢?一些谷歌搜索似乎建议我必须将我的用户名和各种组添加到集群,但这听起来不对。当然,如果我将 DFS 目录模式设置为 777,这会起作用,但这是不对的。

请帮助,在此先感谢。

最佳答案

hadoop.security.group.mapping 的定义(写成here)是:

Class for user to group mapping (get groups for a given user) for ACL. The default implementation, org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback, will determine if the Java Native Interface (JNI) is available. If JNI is available the implementation will use the API within hadoop to resolve a list of groups for a user. If JNI is not available then the shell implementation, ShellBasedUnixGroupsMapping, is used. This implementation shells out to the Linux/Unix environment with the bash -c groups command to resolve a list of groups for a user.

要实现您的目标,您需要在 NameNode 机器上添加您的用户帐户 (clott),并将其添加到那里的 hadoop 组。

如果您要与您的用户一起运行 MapReduce,您还需要在 NodeManager 主机上配置您的用户帐户。

关于linux - 无法写入 Hadoop DFS 目录模式 775 组权限 UserGroupInformation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34418647/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com