原我是这样写的
//输入数据所在的文件目录 FileInputFormat.addInputPath(job, new Path("/input/")); //mapreduce执行后输出数据目录 FileOutputFormat.setOutputPath(job, new Path("/output/"));
这个错误原因是路劲错误,应加上hdfs中core-site.xml中配置路径,我的hdfs配置路径为hdfs://test1:9000
改为
//输入数据所在的文件目录 FileInputFormat.addInputPath(job, new Path("hdfs://test1:9000/input/")); //mapreduce执行后输出数据目录 FileOutputFormat.setOutputPath(job, new Path("hdfs://test1:9000/output/"));
问题解决,记住数据路径不需要创建,只创建输入文件路径即可
转载于:https://www.cnblogs.com/iberichman/p/7127191.html
相关资源:数据结构—成绩单生成器