从主集群定期的导出最近两个快照之差,然后导入到备集群。
rbd export-diff test_pool/test_image testimage_now
rbd import-diff testimage_now test_pool/test_image
echo "v0.log" >> /mnt/ceph_lihang/v0.log
#create snap v1
rbd snap create test_pool/test_image@v1
echo "v1.log" >> /mnt/ceph_lihang/v1.log
#create snap v2
rbd snap create test_pool/test_image@v2
echo "v2.log" >> /mnt/ceph_lihang/v2.log
#create snap v3
rbd snap create test_pool/test_image@v3
echo "v3.log" >> /mnt/ceph_lihang/v3.log
#create snap v4
rbd snap create test_pool/test_image@v4
echo "v4.log" >> /mnt/ceph_lihang/v4.log
#create snap v5
rbd snap create test_pool/test_image@v5
echo "v5.log" >> /mnt/ceph_lihang/v5.log
#export snap v1
rbd export-diff test_pool/test_image@v1 testimage_v1
#export snap v2
rbd export-diff test_pool/test_image@v2 testimage_v2
#export snap v3
rbd export-diff test_pool/test_image@v3 testimage_v3
#export snap v4
rbd export-diff test_pool/test_image@v4 testimage_v4
#export snap v5
rbd export-diff test_pool/test_image@v5 testimage_v5
#import snap v1
rbd import-diff testimage_v1 test_pool/test_image
#import snap v2
rbd import-diff testimage_v2 test_pool/test_image
#import snap v3
rbd import-diff testimage_v3 test_pool/test_image
#import snap v4
rbd import-diff testimage_v4 test_pool/test_image
#import snap v5
rbd import-diff testimage_v5 test_pool/test_image
echo "v0.log" >> /mnt/ceph_lihang/v0.log
#create snap v1
rbd snap create test_pool/test_image@v1
echo "v1.log" >> /mnt/ceph_lihang/v1.log
#create snap v2
rbd snap create test_pool/test_image@v2
echo "v2.log" >> /mnt/ceph_lihang/v2.log
#create snap v3
rbd snap create test_pool/test_image@v3
echo "v3.log" >> /mnt/ceph_lihang/v3.log
#create snap v4
rbd snap create test_pool/test_image@v4
echo "v4.log" >> /mnt/ceph_lihang/v4.log
#create snap v5
rbd snap create test_pool/test_image@v5
echo "v5.log" >> /mnt/ceph_lihang/v5.log
#首次导出 export v1
rbd export-diff test_pool/test_image@v1 testimage_v1
#export (snap v1 - snap v2)
rbd export-diff test_pool/test_image@v2 --from-snap v1 testimage_v1_v2
#export (snap v2 - snap v3)
rbd export-diff test_pool/test_image@v3 --from-snap v2 testimage_v2_v3
#export (snap v3 - snap v4)
rbd export-diff test_pool/test_image@v4 --from-snap v3 testimage_v3_v4
#export (snap v4 - snap v5)
rbd export-diff test_pool/test_image@v5 --from-snap v4 testimage_v4_v5
#import snap v1
rbd import-diff testimage_v1 test_pool/test_image
#import (snap v1 - snap v2)
rbd import-diff testimage_v1_v2 test_pool/test_image
#import (snap v2 - snap v3)
rbd import-diff testimage_v2_v3 test_pool/test_image
#import (snap v3 - snap v4)
rbd import-diff testimage_v3_v4 test_pool/test_image
#import (snap v4 - snap v5)
rbd import-diff testimage_v4_v5 test_pool/test_image
最终选择方案三定期的备份增量文件,达到增量备份。
1.在主集群创建Image的快照
2.导出主集群Image的全量快照
3.将导出的全量快照文件传输到备集群
4.备集群创建对应的pool/image
5.导入全量快照文件到备集群中
6.完成备份
1.在主集群查找最近的快照文件,并且确认备集群是否存在同名的快照
2.在主集群创建Image的快照
3.导出最近快照文件和刚创建快照文件的差量文件。(导出每次diff,实现增量备份)
4.将导出的差量快照文件传输到备集群
5.导入全量快照文件到备集群中
6.完成备份
作者:李航
个人简介: 多年的底层开发经验,在高性能nginx开发和分布式缓存redis cluster有着丰富的经验,目前从事分布式存储Ceph工作。
先后在58同城、汽车之家、优酷土豆集团工作。
目前供职于滴滴基础平台运维部-技术专家岗位,主要负责分布式Ceph系统。
个人主要关注的技术领域:高性能Nginx开发、分布式缓存、分布式存储。
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞5
添加新评论0 条评论