Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Why can't I upload a simple text file onto HDFS ?

avatar

I've been trying to upload a basic txt file onto HDFS but it won't upload. I have tried multiple files of different sizes and extensions and found the reason to be the size of my text file (approx 150 bytes). All files over around 10kb seems to work fine... Does anyone have a solution to this ? Thanks

Kelvin

1 ACCEPTED SOLUTION

avatar
Super Guru

@Kelvin Tong

Based on the screen shots you are providing, you are attempting to push the file to HDFS using the command line within the Sandbox itself. However, you are specifying a file path that is local to the computer running the VIrtualBox Sandbox VM. That won't work. The Sandbox has no way of knowing how to access "C:\".

You must first push the file to the Sandbox using WinSCP. Then you can use the hdfs dsfs -put command using a local directory within the Sandbox (something like /root/<my filename>).

View solution in original post

12 REPLIES 12

avatar
Super Collaborator

What error it throws? Thanks.

avatar

there isn't a specific error. Usually when I drag and drop a file onto the cloud icon, it quickly uploads. But when i drag and drop my txt files there is no response. I have seen other people successfully upload files of less than 1kb on youtube so I know it is possible. I just don't know why mine isn't working

avatar

avatar
Contributor

Can you try manually uploading the file from CLI using the below command?

hdfs dfs -copyFromLocal <localsrc> URI

OR

hdfs dfs -put <localsrc> ... <dst>

Eg: hdfs dfs -put localfile /user/hadoop/hadoopfile

avatar

@Ram Charan Tej

I've tried that but i keep getting the error as shown below:

14601-example.png

Am i just typing my file path wrong ? As you can see I'm trying to upload 'booth1.txt'

Thanks for your help !

avatar
Contributor

Can you remove the backslash before the "\"C:\users 1. 'L' is caps for 'Local' not small letter, so it is hdfs dfs -copyFromLocal <source> hdfs://<URI> 2. you have to remove backslash before "C" drive and try !

avatar

Hello, I've tried it but it still doesn't work for me. Sorry I'm pretty new to this so if possible could you type out exactly what

14605-example.png

I should be typing ?? Thanks heaps ! The error I'm getting is shown below:

avatar
@Kelvin Tong

Are you trying to copy the file from windows to hadoop? I think the file which you are trying to be copied should be present in the server on which hadoop is installed..

avatar

@Bala Vignesh N V

Yes, the file is currently on windows. How do i put it on the server ? My host is 127.0.0.1