2015-10-14 128 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

相关问题