2016-02-26 373 views
1
  1. 我已经创建了输入文本文件test.txt并把它作为HDFS /user/yogesh/Input/test.txt
  2. 创建的输出路径上HDFS为/用户/约杰什/输出
  3. 创建于本地/home/yogesh/WordCount.jar jar文件,并提交当地MR的工作,这样的:hadoop jar /home/yogesh/WordCount.jar WordCount /user/yogesh/Input/test.txt /user/yogesh/Output/output1

我有以下错误:线程“main”中的异常org.apache.hadoop.mapreduce.lib.input.InvalidInputException:输入路径不存在:hdfs:host/user/yogesh/WordCount

Exception in thread "main"
org.apache.hadoop.mapreduce.lib.input.InvalidInputException:Input path does not exist: hdfs:host/user/yogesh/WordCount.

hdfs:host/user/yogesh/- 是我的HDFS目录。我无法理解为什么这个MR作业在HDFS中寻找代码以及如何解决这个错误。

回答

0

先给名包类字计数作为其前缀,或者只是跳过级,并只使用广口瓶,输入,输出,这样的:

hadoop jar /home/yogesh/WordCount.jar /user/yogesh/Input /user/yogesh/Output/output1 

同时,确保/user/yogesh/Output/output1不存在在执行此命令之前。此外,请注意您应该提供输入目录而不是输入文件。 Hadoop将把指定目录中的所有文件作为输入。

有关示例,请参阅this site中WordCount示例的运行方式。

相关问题