1. 程式人生 > >hadoop dfs put File does not exist

hadoop dfs put File does not exist

瘋掉了,測試Hadoop下的wordcount示例,需要複製檔案到hdfs,照書上的操作使用

$ ./hadoop dfs -put ~/input/file0* input

出現錯誤

put: File /home/shan/input/file01.txt does not exist.
File /home/shan/input/file02.txt does not exist.

太可笑了,Cygwin都已經解析出萬用字元*,竟然說檔案不存在。搞了幾個小時,終於在http://www.hindoogle.com/blog/2009/12/cygwin-vs-hadoop-dfs-copy/找到了解決方案。

原來是路徑錯誤,不能用左劃線分割的Unix風格的路徑即,‘/',要用帶轉義字元的window風格的路徑,’\\',而且要用window下的絕對路徑