在集群上运行mapreduce程序时,输入路径被视为输出路径

时间:2019-06-09 08:52:29

标签: hadoop mapreduce

当我在集群上运行map-reduce程序时,输入路径被视为输出路径,所以我总是遇到关于

的错误
  

输出目录已经存在。

但是当我忽略DriverClass的参数时,程序将成功运行。 我真的不知道为什么会这样。而且我可以在IntelliJ IDEA中运行该程序,我在本地环境中得到了正确的答案。

我没弄错输入路径的索引和输出路径的

FileInputFormat.setInputPaths(job,new Path(args[0]));
FileOutputFormat.setOutputPath(job,new Path(args[1]));

HDFS结构

enter image description here

以及下面的我的hadoop命令和错误消息

enter image description here

但是,在我忽略了DriverClass参数之后,程序成功运行了

enter image description here

1 个答案:

答案 0 :(得分:0)

您的问题在于:

android:fullBackupContent="false"

FileInputFormat.setInputPaths(job,new Path(args[0])); FileOutputFormat.setOutputPath(job,new Path(args[1])); 实际上是类名,因此您想使用args[0]作为输入,使用args[1]作为输出。

相关问题