首页 > 数据库 > > 命令行参考-恢复命令
restore命令用于将主集群同步的备份文件在备集群上执行恢复。
python SyncDataToStby.py -t restore --config-file <configFile> [--latest]参数说明
完整选项 | 缩写选项 | 数据类型 | 说明 | 取值类型 | 缺省值 | 应用实例 |
|---|---|---|---|---|---|---|
-t | 不涉及 | 字符串 | 双集群接口支持多种功能。指定该参数为restore,表示调用同步恢复功能。 |
| 不涉及 | -t restore |
--config-file | 不涉及 | 字符串 | 双集群容灾配置文件存放路径。 说明:
| 不涉及 | 不涉及 | --config-file /home/userA/config.ini |
--latest | 不涉及 | 不涉及 | 可选参数。从最新的全量备份恢复到最新的增量备份。 | 不涉及 | 不涉及 | --latest |
--resume-restore | 不涉及 | 不涉及 | 该参数用于指定本次全量恢复是否为断点续做。 当数据较多时,全量恢复失败如果不想重头再做,可以在全量恢复开始时加上此参数,可在断掉的位置继续做全量恢复。 说明:
| 不涉及 | 不涉及 | --resume-restore |
--restore-no-clean | 不涉及 | 不涉及 | 该参数用于全量恢复断点续作失败后,需要再次重入做断点续作恢复,需要加上此参数才可正常继续恢复。 说明:
| 不涉及 | 不涉及 | --resume-restore --restore-no-clean |
周期性恢复:
python SyncDataToStby.py -t restore --config-file /home/userA/config.ini从最新的全量备份恢复到最新的增量备份:
python SyncDataToStby.py -t restore --config-file /home/userA/config.ini --latest说明:
恢复为周期性恢复,在恢复周期中,恢复完后可提供只读业务,直至下一个周期。
系统回显
multi_roach@lfgp000602258:~/db/bin/script> python SyncDataToStby.py -t restore --config-file /data/package_multi/config.ini
Set Crontab for restore.
There is no remaining status.
20181227_153508 is full backup, stop find the list.
Stop cluster before restore.
Stop cluster successfully.
Do restore.
20181227_153508 will do full restore.
Set cluster to be read only mode.
Start cluster for pgxc.
Start cluster successfully.
Stop cluster before copy pgxc node files to tmp dir.
Stop cluster successfully.
Do start again.
Start cluster successfully.
Successfully updated catalog.
Restore thread will sleep 46s until next cycle.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3132882/ ,如需转载,请注明出处,否则将追究法律责任。