我试着从这里运行Apache MapReduce 2.7的基本WordCount示例:
我将输入文件放在: /user/hadoopLearning/WordCount/ input / Output路径: /user/hadoopLearning/WordCount/output/
然后,我运行了以下命令:
hadoop jar wc.jar WordCount /user/hadoopLearning/WordCount/input/file01 /user/hadoopLearning/WordCount/output然而,在运行时,我得到了以下错误:
Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: **Output directory** hdfs://sandbox.hortonworks.com:8020/user/hadoopLearning/WordCount/**input**/file01 already exists我没有写一段代码,也没有从Apache的网站上复制上述位置的所有内容。
我理解这个错误,但是如果我们仔细观察这个错误,它会指出输出目录已经存在,并且在堆栈跟踪中,它会给出输入目录的路径。
有谁能帮帮我吗?我是hadoop领域的初学者。提前谢谢。
发布于 2017-08-24 17:49:55
您正在尝试创建已存在的文件。
HDFS不允许这样做。
将您的输出路径('/user/hadoopLearning/WordCount/ output ')替换为其他路径。
尝试此命令
hadoop jar wc.jar WordCount /user/hadoopLearning/WordCount/input/file01 /user/hadoopLearning/WordCount/new_output_pathhttps://stackoverflow.com/questions/45836569
复制相似问题