seabox mirrorcluster
seabox mirrorcluster¶
灾备集群相关命令
seabox mirrorcluster initrep¶
灾备集群初始化工具
- 语法
-
``` bash seabox mirrorcluster initrep [OPTIONS]
Options: -a, –all init all module replication -m, –module TEXT module filter, including 'coordinator', 'executor'
-i, –dbid TEXT module dbid -p, –parallel INTEGER init replication parallel degree -s, –sync external replication is sync mode -t, –data-sync-type TEXT data sync type, including 'basebackup', 'rewind' –no_restart manually restart the cluster later -h, –help show this help, then exit
```
- 描述
-
灾备集群初始化工具
- 注意:如有注意事项,补充
- 选项
-
该命令支持选项说明如下:
- Options
-
命令支持的选项
-a, --all
- 集群所有模块建立灾备集群流复制
-m, --module TEXT
- 集群指定模块建立灾备集群流复制,包括'coordinator'和'executor'
-i, --dbid TEXT
- 指定模块dbid
-p, --parallel INTEGER
- 初始化复制并行度
-s, --sync
- 建立集群间同步流复制
-t, --data-sync-type TEXT
- 指定数据同步的方式,包括'basebackup','rewind'
--no_restart
- 第一次搭建主备集群时,需要重启主集群使配置生效。指定这个参数可以不在搭建主备集群时重启,而是之后再手动进行重启
-h, --help
- 使用该选项时返回seabox mirrorcluster initrep命令的帮助信息
- 注解
- 如有具体的使用限制及注意事项,在这部分列出。
- 示例
-
以下是
seabox mirrorcluster initrep --help
的执行结果:[seabox@mpp-test-1 bin]$ seabox mirrorcluster initrep --help init mirror cluster replication. Usage: seabox mirrorcluster initrep [OPTIONS] Options: -a, --all init all module replication -m, --module TEXT module filter, including 'coordinator', 'executor' -i, --dbid TEXT module dbid -s, --sync external replication is sync mode -t, --data-sync-type TEXT data sync type, including 'basebackup', 'rewind' --no_restart manually restart the cluster later -h, --help show this help, then exit
集群间建立异步流复制, 默认优先尝试rewind方式同步数据,如果失败后则使用basebackup同步数据
seabox mirrorcluster initrep -a
集群间建立同步流复制,不指定参数–sync时,默认建立异步流复制模式
seabox mirrorcluster initrep -a --sync
如果备集群已经做过初始化流复制了,有一定的基础数据后,可以指定使用rewind方式与主集群再次建立流复制
seabox mirrorcluster initrep -a -t rewind
如果是备集群第一次初始化流复制,则可以指定basebackup方式,建立流复制
seabox mirrorcluster initrep -a -t basebackup
- 相关命令
- 无
seabox mirrorcluster upgrade¶
灾备集群备升主工具
- 语法
-
``` bash seabox mirrorcluster upgrade [OPTIONS]
Options: -c, –check collect mirror cluster consistency infomation only
-m, –mode [upgrade|flashback|all] 'upgrade': upgrade without flashback; 'flashback': flashback cluster; 'all': upgrade and flashback mirror
-x, –xid TEXT the cluster gxid for flashback -r, –reset reset primary cluster replication config –syncconfig synchronize the primary cluster configuration
-t, –thread TEXT maximium size of threads in thread pool, default is 32
-y, –assumeyes answer yes for all questions -v, –verbose show verbose runtime output -h, –help show this help, then exit ```
- 描述
-
灾备集群备升主工具,将备份集群升为主集群,提供用户正常使用。
- 注意:如有注意事项,补充
- 选项
-
该命令支持选项说明如下:
- Options
-
命令支持的选项
-c, --check
- 收集备集群事务一致性信息
-m, --mode [upgrade|flashback|all]
- 选择执行模式
upgrade
: 仅备集群升主,不做数据拉平flashback
: 做数据拉平,仅能在主集群(或单集群)上执行all
: 备集群升主,并数据拉平x, --xid GID
- 指定数据拉平的目标事务号
-r, --reset
- 清理主集群上灾备集群相关配置参数
--syncconfig
- 备集群同步主集群配置参数
-t, --thread TEXT
- 指定备集群升主时的并行度
-y, --assumeyes
- 所有的提问按照yes执行
-v, --verbose
- 显示详细执行日志
-h, --help
- 使用该选项时返回seabox mirrorcluster upgrade命令的帮助信息
- 注解
-
如有具体的使用限制及注意事项,在这部分列出。
-
注意:
-
-r --reset
参数仅能在主集群执行 -
--syncconfig
参数需要在主集群可用状态下执行 -
-m flashback
参数仅能在主集群执行
-
- 示例
-
以下是
seabox mirrorcluster upgrade --help
的执行结果:[seabox@mpp-test-1 bin]$ seabox mirrorcluster upgrade --help upgrade mirror cluster. Usage: seabox mirrorcluster upgrade [OPTIONS] Options: -c, --check collect mirror cluster consistency infomation only -m, --mode [upgrade|flashback|all] 'upgrade': upgrade without flashback; 'flashback': flashback cluster; 'all': upgrade and flashback mirror -x, --xid TEXT the cluster gxid for flashback -r, --reset reset primary cluster replication config --syncconfig synchronize the primary cluster configuration -t, --thread TEXT maximium size of threads in thread pool, default is 32 -y, --assumeyes answer yes for all questions -h, --help show this help, then exit
检查集群事务一致性信息
seabox mirrorcluster upgrade -c
备份集群提升为主
seabox mirrorcluster upgrade -m all
执行备份集群升主,指定并行度为64
seabox mirrorcluster upgrade -m all -t 64
在主集群或单机群上做数据拉平,指定目标事务号
seabox mirrorcluster upgrade -m flashback -x GID
备集群同步主集群参数
seabox mirrorcluster upgrade --synconfig
清理主集群上的灾备集群配置参数
seabox mirrorcluster upgrade -r
- 相关命令
- 无