ITPub博客

首页 > 大数据 > Hadoop > Win7 eclipse Hadoop Failed to set permissions of path

Win7 eclipse Hadoop Failed to set permissions of path

Hadoop 作者:drlyxin 时间:2012-12-04 15:17:29 0 删除 编辑

原:http://blog.csdn.net/shiqidide/article/details/7585048

hadoop1.0.4在windows远程调试linux的程序时,报错:

12/04/24 15:32:44 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
12/04/24 15:32:44 ERROR security.UserGroupInformation: PriviledgedActionException as:Administrator cause:java.io.IOException: Failed to set permissions of path: mphadoop-AdministratormapredstagingAdministrator-519341271.staging to 0700
Exception in thread "main" java.io.IOException: Failed to set permissions of path: mphadoop-AdministratormapredstagingAdministrator-519341271.staging to 0700
    at org.apache.hadoop.fs.FileUtil.checkReturnValue(FileUtil.java:682)
    at org.apache.hadoop.fs.FileUtil.setPermission(FileUtil.java:655)
    at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:509)
    at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:344)
    at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:189)
    at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:116)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:856)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1093)
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
    at com.hadoop.learn.test.WordCountTest.main(WordCountTest.java:85)

 

这个是Windows下文件权限问题,在Linux下可以正常运行,不存在这样的问题。

解决方法是,修改/hadoop-1.0.4/src/core/org/apache/hadoop/fs/FileUtil.java里面的checkReturnValue,注释掉即可(有些粗暴,在Window下,可以不用检查)
[java] view plaincopy
  1. ......  
  2.   private static void checkReturnValue(boolean rv, File p,  
  3.                                        FsPermission permission  
  4.                                        throws IOException  
  5.       
  6.    
  7. ......  

重新编译打包hadoop-core-1.0.4.jar,替换掉hadoop-1.0.4根目录下的hadoop-core-1.0.4.jar即可。

以下是我编译成功的hadop-core-1.0.4.jar:http://download.csdn.net/detail/snow_eagle_howard/4842134

替换之后,刷新项目,设置好正确的jar包依赖,现在再运行WordCountTest,即可。

<!-- 正文结束 -->

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21322852/viewspace-1120035/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2009-04-07