doris跨hdfs集群迁移数据

 

官网-数据备份

步骤一,在doris A集群执行:
CREATE REPOSITORY `repotestall`
WITH BROKER `broker_name`
ON LOCATION "hdfs://xx.xx.xx.xx:9000/repotestall"
PROPERTIES
(
   "username" = "user",
   "password" = "password"
);


步骤二:
BACKUP SNAPSHOT test.snapshotalldoris
TO repotestall
ON (tableA,tableB,tableC)
PROPERTIES ("type" = "full");


步骤三:把文件物理复制到另一个集群。
hadoop fs -get /repotestall  /doris_send
scp -r  -P11112  /doris_send/repotestall  root@xxxxxx:/doris_accept


步骤四:在B集群上传到目录。
hadoop fs -put * /repotestall


步骤五:在dorisB集群创建REPOSITORY
CREATE REPOSITORY `repotestall`
WITH BROKER `broker_name`
ON LOCATION "hdfs://B集群的地址/repotestall"
PROPERTIES
(
   "username" = "user",
   "password" = "password"
);

步骤六:在doris B集群执行:
SHOW SNAPSHOT ON repotestall WHERE SNAPSHOT = "snapshotalldoris";
根据获取的修改下边的时间

RESTORE SNAPSHOT test.snapshotalldoris
FROM repotestall  
ON (tableA,tableB,tableC) 
PROPERTIES
(
    "replication_num" = "1", 
    "backup_timestamp"= "2023-06-01-16-11-33" 
);

中间若干查看命令:

查看最近一次 restore 作业的执行情况:SHOW RESTORE\G;   

查看最近一次 backup 作业的执行情况:SHOW BACKUP

创建一个远端仓库路径,用于备份或恢复:CREATE REPOSITORY

删除已创建的远端仓库。删除仓库: DROP REPOSITORY

查看broker的情况:show broker 

你可能感兴趣的:(hdfs,hadoop,大数据)