简体   繁体   中英

How to transfer file from local disk to Cloudera Virtual Machine? (I've looked through SO and found nothing)

This is pretty trivial, so trivial that I haven't been able to find anything on here.

So, my task is quite simple. Take a simple .txt file and transfer it onto an hdfs directory in cloudera.

I've tried this:

在此处输入图片说明

but no luck. Any help or guidance would be much appreciated.

Assuming that you have already copied files to VM and you are logged into VM (linux), the command you should be using is:

hdfs dfs -copyFromLocal <local-linux-path> <hdfs-path>

If you don't have your home directory created on HDFS, then create it first using:

hdfs dfs -mkdir -p /user/madhav/

The path you are giving in the command you have shown looks wrong to me. It should look something like:

hdfs dfs -copyFromLocal /home/madhav/file.txt /user/madhav/

Then you can check your file on hdfs with:

hdfs dfs -ls /user/madhav/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM