一.概述
doris支持通过腾讯云bos、阿里云oss、hdfs实现备份与恢复,但是我们公司doris部署在线下机房,如采用oss/bos, 大数据备份与恢复比较慢,会占用一定的带宽,如采用hdfs,担心小文件太多影响现有的hadoop集群。为了保险起见,而且能够达到快速的备份恢复,我们实现自主搭建一套minio对象存储。
二.目的
1.当FE元数据发生损坏无法恢复时,我们能快速的从minio恢复,内网带宽拉满
2.当需要升级doris时,我们可以搭建一个测试集群,从minio快速copy数据测试
三.实现
1 )创建repository仓库
CREATE REPOSITORY `minio`
WITH S3
ON LOCATION "s3://doris"
PROPERTIES
(
"AWS_ENDPOINT" = "http://10.254.3.xx:9898",
"AWS_ACCESS_KEY" = "minio",
"AWS_SECRET_KEY"="minioadmin",
"AWS_REGION" = "us-east-1",
"use_path_style" = "true"
);
2 )查看仓库
show repositories
3)备份指定库的指定表
BACKUP SNAPSHOT dal.snapshot_dal
TO minio
ON (example_tbl)
4)备份指定库所有表
BACKUP SNAPSHOT dal.snapshot_dal
TO minio
5)查看备份进度
use dal;
show backup;
3.doris恢复
1)查看存在哪些备份
SHOW SNAPSHOT ON minio;
2)恢复整个db
RESTORE SNAPSHOT dal.snapshot_dal
FROM `minio`
PROPERTIES
(
"backup_timestamp"="2023-05-15-12-06-44",
"replication_num" = "3"
);
3)恢复指定的表
RESTORE SNAPSHOT dal.snapshot_dal
FROM `minio`
ON ( `backup_tbl` )
PROPERTIES
(
"backup_timestamp"="2023-05-15-12-06-44",
"replication_num" = "3"
);
当要快速恢复应用时,可以先暂时设置副本为1,后续再动态增加副本数
评论区