Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs://localhost:9000/user/weiwei/input
一、問題具體如下
二、解決辦法
右鍵點擊剛創建的 WordCount.java,選擇 Run As -> Run Configurations,在此處可以設置運行時的相關參數(如果 Java Application 下面沒有 WordCount,那麼需要先雙擊 Java Application)。切換到 “Arguments” 欄,在 Program arguments 處填寫 如下
hdfs://localhost:9000/user/hadoop/input
hdfs://localhost:9000/user/hadoop/output
注意:圖片中input的在hdfs的絕對路徑:hdfs://localhost:9000/user/hadoop/input
而hdfs://localhost:9000/user/hadoop/output是運行後自動生成的路徑,原本文件是沒有的。
三、運行結果
原本的文件如下:
運行程序右鍵點擊Refresh,刷新哈
就會發現多了已經生成的output文件