2015-10-14 116 views
0

我知道有一個熟悉的標題問題,但我們問的是不同的。 我想這複製文件從本地到HDFS

[email protected]:/usr/local/hadoop$ bin/hadoop dfs -copyFromLocal /tmp/Text /home/hduser/Text 

而且我得到這個:

DEPRECATED: Use of this script to execute hdfs command is deprecated. 
Instead use the hdfs command for it. 

15/10/14 10:15:21 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 
copyFromLocal: `/home/hduser/Text': No such file or directory 
​ 

不過,我有到/ home/hduser /文本和我使用HDFS命令 是什麼錯誤呢?我該如何修復它

+0

您是否嘗試過在目標路徑中指定的服務器和端口:'HDFS: // /home/hduser/T ext'? –

+0

我正在單節點上工作。我需要指定服務器和端口嗎? –

回答

1

但是,我確實有/ home/hduser/Text而我正在使用hdfs命令 錯誤的含義是什麼?我該如何修復它

/home/hduser/Text不存在或語法不正確。對於後一種情況,請嘗試以下:

[email protected]:/usr/local/hadoop$ bin/hadoop dfs -copyFromLocal /home/hduser/Text /tmp/Text

To get rid of warning - DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it. 

[email protected]:/usr/local/hadoop$ hdfs dfs -copyFromLocal /home/hduser/Text /tmp/Text

copyFromLocal: 

Usage: hdfs dfs -copyFromLocal <localsrc> URI 

Similar to put command, except that the source is restricted to a local file reference. 

Options: 

    The -f option will overwrite the destination if it already exists. 
+0

但是/ tmp/Text是我的本地文件 –

+0

通過使用hdfs dfs命令,有關hdfs命令的警告消失了。但是我仍然有15/10/14 11:30:56 WARN util.NativeCodeLoader:無法爲您的平臺加載native-hadoop庫......在適用的情況下使用內建java類 –

+0

請檢查/ home/hduser/Text是否存在在HDFS上。運行hadoop fs -ls/home/hduser /文本 – Vinkal

相關問題