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