org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input


原我是这样写的

//输入数据所在的文件目录
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/"));

问题解决,记住数据路径不需要创建,只创建输入文件路径即可


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM