Win下Eclipse提交hadoop程序出错:org.apache.hadoop.security.AccessControlException: Permission denied

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


org.apache.hadoop.security.AccessControlException: org.apache.hadoop.security.AccessControlException: Permission denied: user=xxx, access=WRITE, inode="root":root:supergroup:rwxr-xr-x
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)


解决方法:

  到服务器上修改hadoop的配置文件:conf/hdfs-site.xml, 找到增加配置(如果有的话则修改value的值为false)

覆盖默认的安全验证,修改完后需要重新启动hadoop服务

<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>


补充:

google看到一篇文章,解释了错误出现的原因,原文地址如下:

http://hi.baidu.com/hontlong/blog/item/9ba50ddbd1e16270d0164ec4.html


因为Eclipse使用hadoop插件提交作业时,会默认以当前windows系统的用户 身份去将作业写入hdfs文件系统中,对应的也就是 HDFS 上的/user/xxx , 我的为/user/hadoop ,   由于 DrWho 用户对hadoop目录并没有写入权限,所以导致异常的发生。他提供的解决方法为:放开 hadoop 目录的权限 , 命令如下 :$ hadoop fs -chmod 777 /user/hadoop  


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值