Hadoop copying local file to HDFS?

2015-04-07T07:06:19

I'm trying to copy a local file called 'afile' to the HDFS. So I ran the following command:

'hadoop fs -copyFromLocal /home/neo/afile in' or 'hadoop fs -put /home/neo/afile in'

However, it says: 'File /home/neo/afile does not exist'

Then I put the file 'afile' into the directory under hadoop. Now the copyFromLocal succeeded. However, the file 'in' is empty, since I run 'hadoop fs - ls', it shows

'-rw-r--r--' 1 neo supergroup 0 2015-04-06 17:45 /user/neo/in

I also tried 'hadoop fs -cat in', nothing returned.

Could someone please help?

Thanks!

Copyright License:
Author:「Neo XU」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/29481130/hadoop-copying-local-file-to-hdfs

About “Hadoop copying local file to HDFS?” questions

I'm trying to copy a local file called 'afile' to the HDFS. So I ran the following command: 'hadoop fs -copyFromLocal /home/neo/afile in' or 'hadoop fs -put /home/neo/afile in' However, it says:
Probably a noob question but is there a way to read the contents of file in hdfs besides copying to local and reading thru unix? So right now what I am doing is: bin/hadoop dfs -copyToLocal hdf...
I asked a similar question to this earlier, but after doing some exploring, I have a better understanding of what's going on, but i'd like to see if other people have alternative solutions to my ap...
The problem I'm encountering is this: Having already put my input.txt (50MBytes) file into HDFS, I'm running python ./test.py hdfs:///user/myself/input.txt -r hadoop --hadoop-bin /usr/bin/hadoop ...
I am new to Hadoop. Is there a bash command to transfer files from the Hadoop distributed file system to the standard file system on a hadoop node. I am using Hadoop 2.6.0 I saw another similar
I'm having a problem with trying to "download" file from HDFS file system to my local system. (even though opposite operation works without a problem). *Note: File exists on the HDFS file system on
Want to copy a file from a remote server to hadoop without copying to edge node. 1.Per below article we can do it in 2 step by first doing scp to local edge node and then perform hdfs fs command t...
I recently installed/configured hadoop and curently trying to run some tests. My problem is with copying local data to hdfs: When I try to run hdfs dfs -copyFromLocal /home/develop/test/ test ...
i'm trying to write python script for copying file to hdfs. i'm working on ubuntu and installed hadoop and pydoop. The following code is my script: import pydoop.hdfs as hdfs class COPYTOHDFS(): ...
Is there any way to list out files from Hadoop hdfs and store only the file names to the local? example: I have a file india_20210517_20210523.csv. I m currently copying the files from hdfs to local

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.