hadoop操作HDFS文件权限问题

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:56   1926   0

描述:在window下使用Eclipse进行hadoop的程序编写,然后Run on hadoop 后,出现如下错误:

11/10/28 16:05:53 INFO mapred.JobClient: Running job: job_201110281103_0003
11/10/28 16:05:54 INFO mapred.JobClient: map 0% reduce 0%
11/10/28 16:06:05 INFO mapred.JobClient: Task Id : attempt_201110281103_0003_m_000002_0, Status : FAILED
org.apache.hadoop.security.AccessControlException: org.apache.hadoop.security.AccessControlException: Permission denied: user=DrWho, access=WRITE, inode="hadoop":hadoop:supergroup:rwxr-xr-x
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

解决方法:

  到服务器上修改hadoop的配置文件:conf/hdfs-core.xml , 找到 dfs.permissions 的配置项 , 将value值改为 false

<property>
<name>dfs.permissions</name>
<value>false</value>
<description>
If "true", enable permission checking in HDFS.
If "false", permission checking is turned off,
but all other behavior is unchanged.
Switching from one parameter value to the other does not change the mode,
owner or group of files or directories.
</description>
</property>

修改完貌似要重启下hadoop的进程才能生效

开发环境:win xp sp3 , Eclipse 3.3 , hadoop-0.20.2

hadoop服务器部署环境: ubuntu 10.10 , hadoop-0.20.2

小结: 接触Hadoop没多久,不知道这样修改对集群的安全性有啥影响。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP