I run Wordcount in Eclipse and my text file exists in hdfs
我在Eclipse中運行Wordcount,我的文本文件存在於hdfs中
Eclipse shows me this error:
Eclipse向我顯示了這個錯誤:
Input path does not exist: file:/home/hduser/workspace/sample1user/hduser/test1
輸入路徑不存在:file:/ home / hduser / workspace / sample1user / hduser / test1
2 个解决方案
#1
Input path does not exist: file:/home/hduser/workspace/sample1user/hduser/test1
輸入路徑不存在:file:/ home / hduser / workspace / sample1user / hduser / test1
Your error shows that the wordcount is searching for the file in local filesystem and not in hdfs. Try copying the input file in local file system.
您的錯誤顯示wordcount正在本地文件系統中而不是在hdfs中搜索該文件。嘗試在本地文件系統中復制輸入文件。
Post the results for following commands in your question:
在您的問題中發布以下命令的結果:
hdfs dfs -ls /home/hduser/workspace/sample1user/hduser/test1
hdfs dfs -ls /home/hduser/workspace/sample1user/hduser
ls -l /home/hduser/workspace/sample1user/hduser/test1
ls -l /home/hduser/workspace/sample1user/hduser
#2
I too ran into the similar issue..(I am a beginner too) I gave the full hdfs path via Arguments for the Wordcount program like below and it worked (I was running the Pseudo-Distributed mode)
我也遇到了類似的問題..(我也是初學者)我通過Arguments為Wordcount程序提供了完整的hdfs路徑,如下所示,它工作(我運行的是偽分布式模式)
hdfs://krishl@localhost:9000/user/Perumal/Input
hdfs://krish@localhost:9000/user/Perumal/Output
hdfs://krish@localhost:9000 is my hdfs location and My hadoop daemons were running during the testing.
hdfs:// krish @ localhost:9000是我的hdfs位置,我的hadoop守護進程在測試期間運行。
Note: This may not be the best practice but it helped me get started!!
注意:這可能不是最好的做法,但它幫助我開始!