首页 > 数据库 > > 命令行参考-配置文件
SyncDataToStby.py工具涉及到如下两个配置文件:
SyncDataToStby.py工具周期性的数据备份和恢复的实现依赖于双集群容灾配置文件。此文件需要用户创建,并且部署在主备集群上。部署路径需要操作系统用户omm可读,且主备集群的双集群容灾配置文件的部署路径必须一致。
本节给出了一个双集群容灾配置文件的示例,用户可以直接复制,在此基础上修改。
示例:
# Configuration file for SyncDataToHA tool
# The backup life cycle
life-cycle=30m
# The table that records backups info
backuprestoreinfo-file=backuprestoreinfo.csv
# The cluster user name for cluster
username=ha
# The primary cluster env set
primary-env=/data/package_ha/v1r6c10_env
# The standby cluster env set
standby-env=/data/package_ha/v1r6c10_env
# Time interval between each full backup, uint: min
full-backup-exec-time-interval=30
# Time interval between each backup
backup-exec-time-interval=5
# One of the backup hosts
primary-host-ip=10.248.106.221
# The media type that restore backup files, DISK
media-type=disk
# The number of process that should be used. Range is (1~32)
parrallel-process=2
# The compression level that should be used for backup. Range(~9)
compression-level=
# Media destination where the backup must be stored
primary-media-destination=/data1/roachbackup/roachbackup/mediadata
# Metadata destination where the metadata must be stored
primary-metadata-destination=/data1/roachbackup/roachbackup/metadata
# The master-port in which the backup must be executed
backup-port=34038
# Logging level for the log contents of backup:FATAL,ERROR,INFO,DEBUG
primary-cluster-logging-level=DEBUG
# Local backup flag
local-backup-flag=/data/ha_install/app/local-backup-flag
# Time interval between each restore, uint: min
restore-interval=20
# One of the restore hosts
restore-host-ip=10.254.255.81
# Media destination where the backup contents must be stored in the standby cluster
restore-media-destination=/data/roach_data/mediadata
# Metadata destination where the backup contents must be stored in the standby cluster
restore-metadata-destination=/data/roach_data/metadata
# The master-port in which the restore must be executed
restore-port=34038
# Logging level for the log contents of restore
standby-cluster-logging-level=INFO
以上参数的详细解释,请参见配置文件参数说明。
SyncDataToStby.py工具主备角色倒换的实现依赖于主备集群倒换配置文件。主备集群倒换配置文件需要用户创建,并且部署在备集群上。部署路径需要操作系统用户omm可读。
本节给出了一个主备集群倒换配置文件的示例,用户可以直接复制,在此基础上修改。
示例:
# Configuration file for SyncDataToHA tool
# The backup life cycle
life-cycle=30m
# The table that records backups info
backuprestoreinfo-file=backuprestoreinfo.csv
# The cluster user name for cluster
username=ha
# The primary cluster env set
primary-env=/data/package_ha/v1r6c10_env
# The standby cluster env set
standby-env=/data/package_ha/v1r6c10_env
# Time interval between each full backup, uint: min
full-backup-exec-time-interval=30
# Time interval between each backup
backup-exec-time-interval=5
# One of the backup hosts
primary-host-ip= 10.254.255.81
# The media type that restore backup files, DISK
media-type=disk
# The number of process that should be used. Range is (1~32)
parrallel-process=2
# The compression level that should be used for backup. Range(~9)
compression-level=
# Media destination where the backup must be stored
primary-media-destination=/data/roach_data/mediadata
# Metadata destination where the metadata must be stored
primary-metadata-destination=/data/roach_data/metadata
# The master-port in which the backup must be executed
backup-port=34038
# Logging level for the log contents of backup:FATAL,ERROR,INFO,DEBUG
primary-cluster-logging-level=DEBUG
# Local backup flag
local-backup-flag=/data/ha_install/app/local-backup-flag
# Time interval between each restore, uint: min
restore-interval=20
# One of the restore hosts
restore-host-ip=10.248.106.221
# Media destination where the backup contents must be stored in the standby cluster
restore-media-destination=/data1/roachbackup/roachbackup/mediadata
# Metadata destination where the backup contents must be stored in the standby cluster
restore-metadata-destination=/data1/roachbackup/roachbackup/metadata
# The master-port in which the restore must be executed
restore-port=34038
# Logging level for the log contents of restore
standby-cluster-logging-level=INFO
以上参数的详细解释,请参见配置文件参数说明。
主备集群倒换配置文件和双集群容灾配置文件中所需要的参数一样。
对于主备集群倒换配置文件,其中:
参数名 | 参数含义 | 参数取值说明 | 参数取值示例 | 参数类别 |
|---|---|---|---|---|
life-cycle | 生命周期。 说明: 备份命令提供生命周期管理功能。即SyncDataToStby.py工具会定期清理主集群和备集群上超过生命周期的备份数据。在生命周期内的备份保留,不在生命周期范围内的备份视为过期备份进行删除。 生命周期管理只在允许周期性进行全量备份的场景下有效,它只关注过期的全量备份,会把过期的全量备份和依赖于它的所有增量备份在主备集群中删除。 | 字符串,数字加单位名称。单位包含:Y(年),M(月),D(日),h(时),m(分),s(秒)。 | 生命周期设置为3天,则‘life-cycle=3D' | 公共参数 |
backuprestoreinfo-file | 双集群同步元数据管理文件。 说明: 双集群在同步时,所产生以及依赖的相关数据都存储在这个元数据文件中,用户只需要在配置文件中配置文件名称即可,存储的路径默认存储在参数restore-meta valign="top" width="23.73237323732374%" headers="mcps1.3.6.5.2.6.1.3 "> 字符串,以‘.csv’为结尾的文件名。 | 'backuprestoreinfo-file=backuprestoreinfo.csv' | 公共参数 | |
username | 安装两套集群的操作系统用户名。 | 字符串,安装两套集群的操作系统用户名。 | username=ha | 公共参数 |
primary-env | 主集群的环境变量存储文件的绝对路径。 | 字符串,主集群的环境变量存储文件的绝对路径,此路径必须存在且可访问。 缺省值为/home/omm/.bashrc。 | primary-env=/data/package_ha/v1r6c10_env | 主集群参数 |
standby-env | 备集群的环境变量存储文件的绝对路径。 | 字符串,备集群的环境变量存储文件的绝对路径,此路径必须存在且可访问。 缺省值为/home/omm/.bashrc。 | standby-env=/data/package_ha/v1r6c10_env | 备集群参数 |
full-backup-exec-time-interval | 全量备份周期。 | 整数。单位默认为分钟。 不可缺省,如果只在开启同步时进行一次全量备份,不进行周期性的全量的备份,可设置为N/A | 设置1h做一次全量备份,则‘full-backup-exec-time-interval=60’ | 主集群参数 |
backup-exec-time-interval | 增量备份周期。 | 整数。单位默认为分钟。 | 设置10分钟做一次增量备份,则‘backup-exec-time-interval=10’ | 主集群参数 |
primary-host-ip | 主集群执行备份的节点ip。 | 字符串,主集群执行备份节点的ip。 说明: 可以是主集群中任一节点。 | primary-host-ip=10.254.254.160 | 主集群参数 |
media-type | 备份所需的介质类型。 | 字符串,目前只支持Disk(磁盘)。 | media-type=Disk | 公共参数 |
parrallel-process | SyncDataToStby.py可以使用的子进程个数。 | 整数,1~32,缺省值为1。 | parrallel-process=3 | 主集群参数 |
compression-level | 备份文件的压缩级别。 | 整数, 0~9,缺省值为0。 0代表快速备份或无压缩。 9代表慢速备份或最大压缩。 说明: 值越小,压缩越快。值越大,压缩越好。表级备份不支持压缩。 | compression-level=5 | 主集群参数 |
primary-media-destination | 主集群的目的备份的绝对路径。 | 字符串, 主集群上存放备份的绝对路径。 | primary-media-destination=/data1/roachbackup/roachbackup/mediadata | 主集群参数 |
primary-meta valign="top" width="22.752275227522755%" headers="mcps1.3.6.5.2.6.1.2 "> 主集群上备份元数据文件位置。 | 字符串, 主集群上备份元数据的绝对路径。 | primary-meta valign="top" width="9.920992099209922%" headers="mcps1.3.6.5.2.6.1.5 "> 主集群参数 | ||
local-backup-flag | 当前集群本地存在备份进程的标志文件位置。 说明:
| 字符串, 备份进程的标志文件所在位置的绝对路径。 可缺省。 | local-backup-flag=/home/ha/localBackupFlag | 主集群参数 |
backup-port | Roach主代理备份进程的执行端口。 | 整数。 取值范围:1024-65535。 | backup-port=34300 | 主集群参数 |
primary-cluster-logging-level | 备份产生的日志级别。 | 可选参数。字符串,取值如下:
| primary-cluster-logging-level=INFO | 主集群参数 |
restore-interval | 恢复周期。 | 整数。单位默认为分钟。 | 恢复周期为10分钟,则restore-interval=10 | 备集群参数 |
restore-host-ip | 备集群执行恢复的节点ip。 | 字符串,备集群执行恢复的节点ip。 说明: 必须是部署集群结构时的主集群ip( primary-host-ip )相对应的备集群的ip。 | restore-host-ip=10.254.255.81 | 备集群参数 |
restore-media-destination | 备集群存放主集群同步的备份文件的路径。 | 字符串,备集群存放主集群同步的备份文件的绝对路径。 | restore-media-destination=/data/roach_data/mediadata | 备集群参数 |
restore-meta valign="top" width="22.752275227522755%" headers="mcps1.3.6.5.2.6.1.2 "> 备集群存放主集群同步的元数据信息的路径。 | 字符串,备集群存放主集群同步的元数据信息的绝对路径。 | restore-media-destination=/data/roach_data/metadata | 备集群参数 | |
restore-port | 恢复进程执行端口。 | 整数。 取值范围:1024-65535。 | backup-port=34300 | 备集群参数 |
standby-cluster-logging-level | 恢复产生的日志级别。 | 可选参数。字符串,取值如下:
| standby-cluster-logging-level=INFO | 备集群参数 |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3125400/ ,如需转载,请注明出处,否则将追究法律责任。