1. 程式人生 > >org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/input

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

utf test exceptio 執行 cep exc 文件目錄 XML 配置

原我是這樣寫的

//輸入數據所在的文件目錄
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/"));

問題解決,記住數據路徑不需要創建,只創建輸入文件路徑即可

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