HDFS主目录 [英] HDFS Home Directory

查看:165
本文介绍了HDFS主目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了单节点多用户hadoop集群。
在我的群集中,有一个负责运行群集的管理员用户(超级用户)。所有其他用户都分配了一个hdfs目录,如/ home / xyz,其中xyz是用户名。

I have setup a single node multi-user hadoop cluster. In my cluster, there is an admin user that is responsible for running the cluster (superuser). All other users are allocated a hdfs directory like /home/xyz where xyz is a username.

在unix中,我们可以在/ etc中更改用户的默认主目录/ passwd文件。默认情况下,用户的登录目录是主目录。

In unix, we can change the default home directory for a user in /etc/passwd. And by default, landing directory for a user is the home directory.

我如何在hdfs文件系统的hadoop中执行此操作。
我想举个例子,如果用户在unix提示符下键入:
$ hadoop dfs -ls。
它将列出我分配的主目录的内容。

How do I do it in hadoop for hdfs file system. I want for example, if user types: $hadoop dfs -ls on the unix prompt. It shall list the contents of the home directory allocated by me.

此外,hdfs目录由运行集群的超级用户创建(hadoop超级用户,而不是unix root),然后将所有权转移给特定用户。

Further, hdfs directories are created by the superuser who runs the cluster(hadoop superuser and not unix root) and then transfers the ownership to a particular user.

推荐答案

我不确定这是可以配置的东西 - DistributedFileSystem (第150行)对getHomeDirectory的调用似乎是硬编码的:

I'm not sure this is something that can be configured - the source for DistributedFileSystem(line 150) has a call for getHomeDirectory that seems to be hard-coded:

@Override
public Path getHomeDirectory() {
  return makeQualified(new Path("/user/" + dfs.ugi.getShortUserName()));
}

如果您想要更改此选项,您有两种可能的选择:

You do have two possible choices if you want to be able to change this:


  • 提交一张票据给hadoop,询问一项新功能 - 查看此链接

  • 自己修改源代码并重新构建+在群集中重新分配hadoop-core jar在您的单节点伪集群中)

这篇关于HDFS主目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆