如何进行GBase 8c数据库的备份和恢复

由于包含着有价值的数据,Gbase 8c数据库需要定期备份。

备份

1.对集群每个cn和dn配置日志归档,命令如下:

gha_ctl configure wal_archive datanode hg_name dn_name 'ssh user@remote "flock -x path archive_wal dn_host dir/%p path %f"' -l dcslist -c cluster

gha_ctl configure wal_archive coordinator cn_name 'ssh user@remote "flock -x path archive_wal cn_host dir/%p path %f"' -l dcslist -c cluster

2.备份topo、dcs、gtm、cn、及各个高可用组:

命令:

gha_ctl backup xxx host path -l dcslist -c cluster

举例:

gha_ctl backup topo host path/topo.json -l dcslist  -c cluster

gha_ctl backup dcs host path -l dcslist  -c cluseter

gha_ctl backup gtm host path -l dcslist  -c cluseter

gha_ctl backup coordinator host path tbs_path -l dcslist -c cluster

gha_ctl backup datanode group host path tbs_path -l dcslist -c cluster

​​​​​​​恢复

1.停止新集群;

2.备份新集群topo信息;

gha_ctl backup topo host path/topo.json -l dcslist -c cluster

3.还原dcs、topo、gtm、各个高可用组、cn;

命令:

gha_ctl restore xxx host path -l dcslist -c cluster

举例:

gha_ctl restore dcs host path -l dcslist -c cluster

gha_ctl restore topo host path/topo.json -l dcslist -c cluster

gha_ctl restore gtm host path -l dcslist -c cluster

gha_ctl restore datanode hg host path tbs_path wal_host wal_path target_type target_info -l dcslist -c cluster

gha_ctl restore coordinator host path tbs_path wal_host wal_path target_type target_info -l dcslist -c cluster

4.还原过程,只会还原第一个gtm、cn及每个高可用组的第一个dn。其他节点,检测到上述节点变为running后,直接start就行了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值