无法写入 Hadoop DFS 目录模式 775 组权限 UserGroupInformation
Cannot write to Hadoop DFS directory mode 775 group permission UserGroupInformation
我 运行 Hadoop 2.6.2 在启用了文件系统权限的私有集群上。集群有密码文件,只有像 hadoop 这样的系统用户,没有个人账户。我正在从一个 linux 边缘节点访问 DFS,该节点具有像我这样的个人帐户 ('clott')。
问题是我无法写入模式 775 和组 hadoop 的 DFS 目录 ('shared');边缘节点显示我是 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 主机上配置您的用户帐户。
我 运行 Hadoop 2.6.2 在启用了文件系统权限的私有集群上。集群有密码文件,只有像 hadoop 这样的系统用户,没有个人账户。我正在从一个 linux 边缘节点访问 DFS,该节点具有像我这样的个人帐户 ('clott')。
问题是我无法写入模式 775 和组 hadoop 的 DFS 目录 ('shared');边缘节点显示我是 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 主机上配置您的用户帐户。