首页 > 数据库 > > 恢复命令-基于备份集(全量/增量)恢复至当前集群
支持从磁盘或NBU恢复集群。
执行恢复操作时的集群中节点数量必须与备份操作完成时的节点数量相同。
恢复集群时会自动停止集群。
在恢复集群之前用户需要执行文件清理操作,用户可在执行恢复命令时增加--clean参数来完成该操作。这样系统会先检测是否满足恢复条件,只有满足时才会清理集群数据。
cd $ROACH_HOME执行恢复操作。
python GaussRoach.py -t restore --mode cluster --clean --master-port master_port --media-destination media_destination_path --media-type type --backup-key backup_key --meta>metadata_path
backup-key可以指向某次全量备份、累积增量备份或者差分增量备份。指向某次全量备份时,进行的是全量恢复。指向累积增量备份或者差分增量备份时,进行的是对应的增量恢复,此时需要注意的是,如果某全量备份已删除,用户无法使用基于该全量备份生成的增量备份来执行恢复操作。

恢复验证
恢复操作成功完成后,运行Roach主代理的屏幕上显示如下信息。
Parsing the configuration file.
Cleaning cluster.
Stopping cluster.
Successfully stopped cluster.
Successfully cleaned cluster.
Performing presetup activities...
SIA1000141083 : ##################################################100% 4.188M/s
SIA1000141082 : ##################################################100% 4.018M/s
SIA1000141081 : ##################################################100% 4.018M/s
Successfully restore data, takes time: 00:02:08.
Performing restore completed.
python GaussRoach.py -t start --media-type media-type示例
python GaussRoach.py -t restore --mode cluster --clean --master-port 6000 --media-destination /home/userA/backup --media-type Disk --backup-key 20160121_190548 --meta>python GaussRoach.py -t restore --mode single --clean --master-port 6000 --media-destination /home/userA/backup --media-type Disk --backup-key 20160121_190548 --meta>基于备份集,从NBU进行全量恢复。
python GaussRoach.py -t restore --mode cluster --clean --master-port 6000 --media-destination /home/userA/media --media-type NBU --backup-key 20160122_190923 --meta>基于备份集,从磁盘进行累积增量恢复。
python GaussRoach.py -t restore --mode cluster --clean --master-port 6000 --media-destination /home/userA/backup --media-type Disk --backup-key 20160125_19054
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3169503/ ,如需转载,请注明出处,否则将追究法律责任。