【发布时间】:2016-11-20 00:28:31
【问题描述】:
在我的 Cloudera VM 上运行 Eclipse 中的基本 Hadoop wordcout 教程时出现错误。错误是:
Input path does not exist: file:/user/cloudera/wordcount/input
但是,这个目录确实存在,我专门创建了它,我在我的 HDFS 文件浏览器中盯着它。
Screenshot of my command line query and browser.
我已将您在 eclipse 中看到的命令中的目录复制粘贴到我的运行配置中,这些是我的参数:
/user/cloudera/wordcount/input /user/cloudera/wordcount/output
并且代码本身并没有从我下载的示例中进行修改,相关行是:
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
编辑:
hadoop jar /home/cloudera/examples/wordcount.jar WordCount /user/cloudera/wordcount/input /user/cloudera/wordcount/output
这个命令在终端中工作,但是当我使用参数“/user/cloudera/ wordcount/input /user/cloudera/wordcount/output" 然后我得到上述错误。
为什么 eclipse 不能正确运行这个任务?它可以在终端上运行。
【问题讨论】:
-
你能显示hadoop命令的执行吗?
-
你可以参考ybhavesh.blogspot.in上的几个例子
-
file:/user/与hdfs:///user/不同。这可能就是您的困惑所在。