将文件从本地复制到HDFS

时间:2015-10-14 15:31:35

标签: hadoop hdfs

我知道有一个熟悉的标题问题,但我们要求的是不同的。 我试过这个

hduser@tong-VirtualBox:/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 / Text我正在使用hdfs命令 错误是什么意思?我该如何解决呢?

1 个答案:

答案 0 :(得分:1)

  

但是,我确实有/ home / hduser / Text而且我正在使用hdfs命令   错误是什么意思?我该如何解决呢?

/ home / hduser / Text不存在或语法不正确。对于以后的情况,请尝试以下:

<强> hduser@tong-VirtualBox:/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.

<强> hduser@tong-VirtualBox:/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.