当前位置: 代码迷 >> 综合 >> 第七章 HDFS—集群间的数据迁移
  详细解决方案

第七章 HDFS—集群间的数据迁移

热度:23   发布时间:2023-12-16 18:51:13.0

        Apache和Apache集群间数据拷贝

  1. scp实现两个远程主机之间的文件复制                                                                                  scp -r hello.txt root@hadoop103:/user/atguigu/hello.txt  // 推 push
    scp -r root@hadoop103:/user/atguigu/hello.txt hello.txt  // 拉 pull
    scp -r root@hadoop103:/user/atguigu/hello.txt root@hadoop104:/user/atguigu //通过本
    地主机中转实现两个远程主机的文件复制;如果在两个远程主机之间 ssh 没有配置的情况下
    可以使用该方式
  2. 采用distcp命令实现两个Hadoop集群之间的递归数据复制:bin/hadoop distcp hdfs://hadoop102:8020/user/atguigu/hello.txt hdfs://hadoop105:8020/user/atguigu/hello.txt