0

I have copied a file from a local to the hdfs file system and the file got copied -- /user/hduser/in

hduser@vagrant:/usr/local/hadoop/hadoop-1.2.1$ bin/hadoop fs -copyFromLocal /home/hduser/afile in

Question:- 1.How does hadoop by default copies the file to this directory -- /user/hduser/in ...Where is this mapping specified in the conf file?

user1050619
  • 19,822
  • 85
  • 237
  • 413

4 Answers4

0

If you write the command like above, the file gets copied to your user's HDFS home directory, which is /home/username. See also here: HDFS Home Directory.

You can use an absolute pathname (one starting with "/") just like in a Linux filesystem, if you want to write the file to a different location.

Community
  • 1
  • 1
Hellmar Becker
  • 2,824
  • 12
  • 18
0

Are u using a default vm? Basically if you configure hadoop from binaries without using the preconfigure yum package. It doesnt have a default path. But if you use yum via hortin or cloudera vm. It comes with default path i guess

0

Check the hdfs-site.xml to see the default fs path. So "/" will point to the base URL set in the above mentioned XML. Any folder mentioned in the command without the use of home path will be appended to that.

DILIP KUMAR
  • 153
  • 1
  • 8
0

hadoop picks the default path defined in hdfs-site.xml and write data. below image clear how writes works in HDFS.

enter image description here

Hari Singh
  • 165
  • 6