0

How can I copy a directory recursively from cluster1 to cluster2 in Hadoop HDFS? The outcome I would like is a directory structure mirrored with data.

kenlukas
  • 3,616
  • 9
  • 25
  • 36
KM Prak
  • 127
  • 1
  • 1
  • 6

1 Answers1

1

Use the built in tool distcp :

bash$ hadoop distcp hdfs://nn1:8020/foo/bar \ hdfs://nn2:8020/bar/foo

See the documentation here : Distcp tool

Mohamed IMLI
  • 38
  • 1
  • 8
  • 1
    No, it will do the the copy of the directories as well as files récursively see this question : https://stackoverflow.com/questions/31862904/how-to-copy-data-from-one-hdfs-to-another-hdfs – Mohamed IMLI Nov 03 '19 at 03:49