4

I want to upload and download file in hadoop. and want to store file in server or multi-node cluster.

2 Answers 2

5

for putting files on hadoop use

 hadoop fs -put /<local machime path> /<hdfs path>

and to get files from hadoop use

 hadoop fs -get /<hdfs path> /<local machime path>     

for more information see this

3
  • Provided link is broken. Nice example why it is recommended to post at least a tl;dr version of the link.
    – Dror
    Jul 14, 2015 at 15:19
  • @Dror link is updated now thanks for the feedback Jul 20, 2015 at 14:15
  • 1
    This is the same link as in the answer, but linked to "current" instead of a specific version "r2.7.0": hadoop.apache.org/docs/current/hadoop-project-dist/…
    – michael
    Aug 20, 2016 at 12:53
1

To copy from local to hdfs, use this command:

hadoop fs -copyFromLocal /temporaryfile.txt hdfs://DFCMSUSEHDSL03.pbi.global.pvt/sunil/temporaryfile.txt

OR

hadoop fs -copyFromLocal /temporaryfile.txt hdfs://DFCMSUSEHDSL03.pbi.global.pvt:8020/sunil/temporaryfile.txt

OR

hadoop fs -put /temporaryfile.txt /sunil/temporaryfile.txt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .