Error while copying the file from local to HDFS

0 votes

I am following a hdfs tutorial for learning different hdfs commands. So far I am able to create a directory in hdfs using the command:

hdfs dfs -mkdir -p sales/january

But, I am getting error while copying the data from local file system to HDFS. I am following all the steps mentioned in the tutorial. Here is the screenshots:

  • Here, is my HDFS directories:
image
  • Here, is the directory where I want to copy the file

image

Now, I am issuing the following command:

hdfs dfs -put january_sales_2017.csv sales/january/january_sale_2017.csv

The error that I am getting is:

put: `sales/january/january_sale_2017.csv': No such file or directory: `hdfs://localhost:8020/sales/january/january_sale_2017.csv`

Please, let me know what I am doing wrong or is there any problem with the hadoop setup. Any help would be appreciated.

May 2, 2018 in Big Data Hadoop by Damon Salvatore
• 5,250 points
230 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Well, the reason you are getting such prompt is because you trying to copy the file into a directory that does not exist. In your case, you are trying to push the files january_sales_2017.csv into sales/january/january_sales_2017.csv directory path. Now, you have not created any sub-dir by the name of january_sales_2017.csv inside sales directory and therefore, giving you the error. So, on case you want to copy the files inside sales/january directory, here is the corrected way to do it:

hdfs dfs -put january_sales_2017.csv /sales/january

answered May 2, 2018 by Ashish
• 2,630 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Copy file from HDFS to the local file system

There are two possible ways to copy ...READ MORE

answered Mar 27, 2018 in Big Data Hadoop by nitinrawat895
• 9,030 points
2,504 views
0 votes
1 answer

How can I put file to HDFS directly without copying it local disk?

Can use pipe from wget to hdfs. You ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
386 views
0 votes
1 answer

How to print the content of a file in console present in HDFS?

Yes, you can use hdfs dfs command ...READ MORE

answered Apr 19, 2018 in Big Data Hadoop by Shubham
• 12,030 points
245 views
0 votes
2 answers

hadoop copy a local file system folder to HDFS

There's a typo in your command: "hadopp". ...READ MORE

answered Feb 4 in Big Data Hadoop by Lohith
1,790 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
547 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 9,030 points
1,632 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
7,921 views
+1 vote
1 answer

Where to set hadoop.tmp.dir? core-site.xml or hdfs-site.xml?

hadoop.tmp.dir (A base for other temporary directories) is ...READ MORE

answered Mar 26, 2018 in Big Data Hadoop by nitinrawat895
• 9,030 points
1,252 views
0 votes
1 answer
0 votes
1 answer

What is the use of sequence file in Hadoop?

Sequence files are binary files containing serialized ...READ MORE

answered Apr 5, 2018 in Big Data Hadoop by Ashish
• 2,630 points
380 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.