我正在使用 Cloudera VM 进行 mapreduce 实践。
我刚刚从 cloudera 提供的默认 wordcount
类创建了 jar。
我在运行 mapreduce 程序时遇到此错误。我能知道我错过了什么吗?
InvalidJobConfException: Output directory not set.
Exception in thread "main" org.apache.hadoop.mapred.InvalidJobConfException: Output directory not set.
最佳答案
要使用 MapReduce 程序处理数据,您需要-
- 映射器类
- reducer 类
- 驱动类(运行MapReduce程序的主类)
- 输入数据(输入数据分析的路径)
- Output directory(输出目录的路径,程序的输出将存放在这里,这个 HDFS 中不应该存在该目录)
从报错来看,好像是你没有设置输出目录路径。如果您的代码中尚未设置输出目录,那么如果您的代码接受相同的参数,则必须在运行时传递它。 Here是在 MapReduce 中运行第一个 WordCount 程序的很好的分步指南。
关于hadoop - 无效的作业 session 异常 : Output directory not set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35472642/