在windows基于Eclipse编写hadoop时,遇到的 WARN util.NativeCodeLoader问题

    xiaoxiao2021-03-25  30

    问题全文如下:

    14/05/29 13:49:16 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable14/05/29 13:49:16 ERROR security.UserGroupInformation: PriviledgedActionException as:ISCAS cause:java.io.IOException: Failed to set permissions of path: \tmp\hadoop-ISCAS\mapred\staging\ISCAS1655603947\.staging to 0700Exception in thread "main" java.io.IOException: Failed to set permissions of path: \tmp\hadoop-ISCAS\mapred\staging\ISCAS1655603947\.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) at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:126) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:942) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Unknown Source) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190) at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936) at org.apache.hadoop.mapreduce.Job.submit(Job.java:550) at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580) at org.apache.hadoop.examples.WordCount.main(WordCount.java:82)

    这是由于windows下编译的权限问题,需要将hadoop-core-1.2.1.jar文件中的FileUtil.class部分修改。

    问题来了,如果修改FileUtil.class文件呢?网上说将FileUtile.java文件中的某个函数注释掉,重新编译即可,这里已经有编译好的FileUtil.class:

    http://pan.baidu.com/s/1pJAxIPX

    问题又来了,如果已经下载了FileUtil.class,如何将这个class导入到原有的hadoop-core-1.2.1.jar包中呢?

    solution:用压缩软件打开hadoop-core-1.2.1.jar文件,找到原有的FileUtil.class文件位置,用新的FiliUtil.class替换到原有的文件即可。然后就可以使用了哈~嘿嘿嘿嘿嘿嘿。

    原文:这里

    转载请注明原文地址: https://ju.6miu.com/read-50264.html

    最新回复(0)