Moving data to hdfs using copyFromLocal switch

后端 未结 1 1916
执念已碎
执念已碎 2021-02-05 18:50

I don\'t know what\'s going on here but I am trying to copy a simple file from a directory in my local filesystem to the directory specified for hdfs.

In my hdfs-site.xm

相关标签:
1条回答
  • 2021-02-05 19:32

    I believe dfs.data.dir and dfs.name.dir have to point to two different and existing directories. Furthermore make sure you have formatted the namenode FS after changing the directories in the configuration.

    While copying to HDFS you're incorrectly specifying the target. The correct syntax for copying a local file to HDFS is:

    bin/hadoop dfs -copyFromLocal <local_FS_filename> <target_on_HDFS>
    

    Example:

    bin/hadoop dfs -copyFromLocal /home/vaibhav/ml-100k/u.data my.data
    

    This would create a file my.data in your user's home directory in HDFS. Before copying files to HDFS make sure, you master listing directory contents and directory creation first.

    0 讨论(0)
提交回复
热议问题