2

我正在为hadoop使用eclipse插件。我可以通过制作一个 hadoop 服务器来查看 HDFS 中的所有文件,但是当我尝试从 eclipse 运行 wordcount.java 文件时,它给了我异常,而从终端它运行顺利。例外情况如下。

2/11/14 04:09:06 WARN util.NativeCodeLoader: Unable to load native-hadoop library for  your platform... using builtin-java classes where applicable
12/11/14 04:09:06 WARN mapred.JobClient: No job jar file set.  User classes may not be     found. See JobConf(Class) or JobConf#setJar(String).
12/11/14 04:09:06 WARN snappy.LoadSnappy: Snappy native library not loaded
12/11/14 04:09:06 INFO mapred.JobClient: Cleaning up the staging area file:/tmp/hadoop-hduser/mapred/staging/hduser1728681403/.staging/job_local_0001
12/11/14 04:09:06 ERROR security.UserGroupInformation: PriviledgedActionException as:hduser cause:org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/user/hduser/gutenberg
Exception in thread "main" org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/user/hduser/gutenberg
    at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:197)
    at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:208)
    at org.apache.hadoop.mapred.JobClient.writeOldSplits(JobClient.java:989)
    at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:981)
    at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897)
    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:1121)
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)
    at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:824)
    at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1261)
    at WordCount.run(WordCount.java:149)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
    at WordCount.main(WordCount.java:155)
4

2 回答 2

2

我将从调查此开始:

ERROR security.UserGroupInformation: PriviledgedActionException as:hduser cause:org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/user/hduser/gutenberg

似乎它导致了问题。你确定这是正确的路径吗?如果是这样,您可能无权访问它。稍后我会尝试尽可能多地消除 WARN。

于 2012-11-14T12:45:03.950 回答
1

感谢 Shujaat 解决了我的问题。从 Eclipse 我遇到了同样的问题...使用 hdfs://localhost:54310/user/... 而不是“/user/...”

于 2013-10-18T17:30:31.667 回答