Hadoop PriviledgedActionException: Failed to set permissions

來源:互聯網
上載者:User

錯誤描述:

13/09/12 17:59:00 ERROR security.UserGroupInformation: PriviledgedActionException as:leo cause:java.io.IOException: Failed to set permissions of path: \tmp\hadoop-leo\mapred\staging\leo480143202\.staging to 0700

Exception in thread "main" java.io.IOException: Failed to set permissions of path: \tmp\hadoop-leo\mapred\staging\leo480143202\.staging to 0700

at org.apache.hadoop.fs.FileUtil.checkReturnValue(FileUtil.java:691)

at org.apache.hadoop.fs.FileUtil.setPermission(FileUtil.java:664)

at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:514)

at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:349)

at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:193)


該bug見https://issues.apache.org/jira/browse/HADOOP-7682


解決方案:

修改FileUtil類checkReturnValue方法重新放入hadoop-core.jar中,

http://blog.csdn.net/java2000_wl/article/details/7598040 提供了hadoop-core-1.0.4.jar,但我用的是hadoop-core-1.2.1.jar。於是我將上面jar中的FileUtil.class提取出來,替換了hadoop-core-1.2.1.jar中的檔案。


替換方法:用7-zip或者其他壓縮軟體開啟hadoop-core.jar,找到org\apache\hadoop\fs目錄,將FileUtil.class替換原jar包的檔案。


此方法能適用於多版本的hadoop-core.jar,只是需要各位自己動一下手。


FileUtil.class

hadoop-core-1.2.1.jar


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.