3

我收到以下错误:当我尝试执行用 Python 编写的 mapreduce 作业时..我无法找到流 *.jar...请建议如何解决此问题..请您也指导我为以下命令编写 bash 文件..

hduser@hadoop-PC:~/hadoop/contrib$ hadoop jar contrib/streaming/hadoop-*streaming*.jar -file /home/hduser/mapper.py    -mapper /home/hduser/mapper.py -file /home/hduser/reducer.py   -reducer /home/hduser/reducer.py -input /user/hduser/gutenberg/* -output /user/hduser/gutenberg-output
Warning: $HADOOP_HOME is deprecated.

Exception in thread "main" java.io.IOException: Error opening job jar: contrib/streaming/hadoop-*streaming*.jar
    at org.apache.hadoop.util.RunJar.main(RunJar.java:90)
Caused by: java.io.FileNotFoundException: contrib/streaming/hadoop-*streaming*.jar (No such file or directory)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:215)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at java.util.jar.JarFile.<init>(JarFile.java:153)
    at java.util.jar.JarFile.<init>(JarFile.java:90)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:88)
4

2 回答 2

0

嗯,愚蠢的问题,但您是否验证了 A)该文件存在并且 B)您有权访问它?另外,尝试访问文件./contrib/streaming/hadoop-streaming.jar,甚至是完全限定的路径。

我刚刚注意到您正在从~/hadoop/contrib. contrib你需要从你的道路上起飞

于 2013-08-10T05:30:18.727 回答
0

好吧,我认为,不是hadoop-streaming.jar,它应该是hadoop-streaming-1.1.2.jar,所以试试这个:

hduser@hadoop-PC:~/hadoop$./bin/hadoop jar contrib/streaming/hadoop-streaming-1.1.2.jar** -file /home/hduser/mapper.py    -mapper /home/hduser/mapper.py -file /home/hduser/reducer.py   -reducer /home/hduser/reducer.py -input /user/hduser/gutenberg/* -output /user/hduser/gutenberg-output
于 2013-08-10T22:51:15.717 回答