如何在两个hdfs集群之间拷贝数据

xiaohanxiaohan
1 min read

在不同的两个HDFS集群中拷贝数据,我们可以使用distcp命令,集群之间拷贝数据的正确姿势是:

hadoop distcp hdfs://master1:9999/foo/bar hdfs://master2:9999/bar/foo

上面的意思是将集群master1上的文件foo/bar拷贝到master2集群上的bar/foo目录下

hadoop distcp hdfs://master1:9999/foo/a hdfs://master1:9999/foo/b hdfs://master2:9999/bar/foo

上面的意思是将master1集群上的两个文件foo/afoo/b拷贝到master2集群上的文件bar/foo中去。

参考

http://hadoop.apache.org/docs/r2.7.5/hadoop-distcp/DistCp.html https://www.cnblogs.com/jichui/p/10444926.html https://blog.csdn.net/weixin_30323961/article/details/95050921

0
Subscribe to my newsletter

Read articles from xiaohan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

xiaohan
xiaohan