本文介绍了在Linux上的hdfs中更改现有用户的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Hadoop的新手,遇到了一个不确定的问题,我不确定该如何解决.

I am new to Hadoop and I've run across an issue I'm not sure how to solve.

我有两个现有的HDFS用户:一个叫hdfs,一个叫user1.当我以user1的身份将文件写入HDFS时,两个用户都可以查看和删除文件.但是,如果我将文件添加为用户hdfs,则当我尝试使用它时,user1会引发文件未找到错误.为什么一个用户可以编辑文件而另一个用户不能编辑文件?我可以做些什么来允许user1也可以编辑文件吗?

I have two existing HDFS users: one called hdfs and one called user1. When I write a file to HDFS as user1, both users can see and delete the files. However if I add the file as the user hdfs, user1 throws a file not found error when I try to use it. Why would one user be able to edit a file while the other can't? Is there anything I can do to allow user1 to also be able to edit the file?

以下是用户的权限:

hdfs  = drwxr-xr-x
user1 = drwxrwxr-x

我正在CentOS 6.6上将HDFS作为OpenJDK 1.8的一部分运行

I am running HDFS as part of OpenJDK 1.8 on CentOS 6.6

推荐答案

hdfs用户是超级用户,因此,每当您将文件复制为hdfs时,其他用途都看不到.如果要查看这些文件,则必须执行如下所示的命令

hdfs user is a super user, so whenever you copy a file as hdfs, other uses cannot see. if you want to see those file you have to execute command as like below

sudo -u hdfs hdfs dfs -cat /path/

user1是普通用户,因此每当您将文件复制为user1时,hdfs用户都可以访问这些文件

user1 is a normal user, so whenever you copy a file as user1, hdfs user can have access to those files

是的,下面有类似的命令可以更改组,用户,所有者等

yes, there is command like below to change groups, users, owners, etc

hdfs dfs chgrp
hdfs dfs chmod
hdfs dfs chown

这篇关于在Linux上的hdfs中更改现有用户的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 01:06