原我是這樣寫的
//輸入數據所在的文件目錄
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/"));
問題解決,記住數據路徑不需要創建,只創建輸入文件路徑即可
