Distcp From Local to HDFS giving error file not found

0 votes

I was checking the ways to copy data from local to HDFS, so I found copyFromLocal, put and distcp command. Distcp performs the operation faster than put or copyFromLocal. So I was trying the same but I am receiving the error FIleNotFoundException. Can anyone help to resolve the error?

Apr 29, 2020 in Big Data Hadoop by Amey
• 210 points
1,763 views

1 answer to this question.

0 votes

Hey, @Amey,

This is probably because of a lack of configuration. Try to add the Hadoop configuration files as a resource to the object Configuration:

Configuration conf = new Configuration();
conf.addResource(new Path("/etc/hadoop/conf/core-site.xml")); 
conf.addResource(new Path("/etc/hadoop/conf/hdfs-site.xml"));
FileSystem hdfs = FileSystem.get(conf);

I hope this will help. If you get any other queries regarding this, please post it here.

answered Apr 29, 2020 by Gitika
• 65,910 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Error while copying the file from local to HDFS

Well, the reason you are getting such ...READ MORE

answered May 3, 2018 in Big Data Hadoop by Ashish
• 2,650 points
3,677 views
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
• 11,380 points
16,413 views
0 votes
1 answer

Not able to create Hive table from HDFS file

You dont have to specify the file name ...READ MORE

answered Dec 5, 2018 in Big Data Hadoop by Omkar
• 69,210 points
2,274 views
0 votes
1 answer
0 votes
1 answer

Copy file from local to hdfs from the spark job in yarn mode

Please refer to the below code: import org.apache.hadoop.conf.Configuration import ...READ MORE

answered Jul 16, 2019 in Big Data Hadoop by Raj
10,804 views
0 votes
2 answers

Not Able to read the file from hdfs location

Please make sure you connect to spark2-shell ...READ MORE

answered Jul 14, 2020 in Big Data Hadoop by Shantanu
• 190 points
1,750 views
+1 vote
1 answer

How to copy file from Local file system to HDFS?

Hi@akhtar, You can copy files from your local ...READ MORE

answered Oct 20, 2020 in Big Data Hadoop by MD
• 95,440 points
2,391 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP