关于 YMatrix
标准集群部署
数据写入
数据迁移
数据查询
运维监控
参考指南
工具指南
数据类型
存储引擎
执行引擎
流计算引擎
灾难恢复
系统配置参数
索引
扩展
SQL 参考
常见问题(FAQ)
当灾难发生时,若主集群侧所有机器物理不可用,此时用户只能在备份集群侧进行操作。
主备切换完成后,备份集群的数据内容不在与主集群保持一致,且无法再次切换回备份集群角色。
在备份集群的 Master 机器,以 mxadmin 的用户身份,执行 mxdr switch 或 mxdr switch -a 命令进行主备切换。
a. 若使用 mxdr switch 进行切换的过程中,会产生以下对话,需再次确认是否进行主备切换。
Continue promoting cluster for disaster recovery to normal cluster? Yy|Nn (default=N):
b. 若使用 mxdr switch -a 进行切换,则可以跳过上述的对话确认过程。
mxadmin 用户身份执行以下命令,以获取 supervisor 管理的 Publisher 的 name 。supervisorctl status
输出结果如下图所示,本例中 name 为 publisher_5V967HARnCHfRMTeyiLQgS。

name 之后,执行以下命令用来停止 Publisher。supervisorctl stop publisher_5V967HARnCHfRMTeyiLQgS
exited。supervisorctl status
示例:

该部分提供了有关灾难恢复功能的命令行操作工具。
mxdr
mxdr 命令用于运行 Subscriber 和 Publisher,以及控制备份数据库集群的切换。
Usage:
mxdr [flags]
mxdr [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
switch Promote disaster recovery cluster
Flags:
-c, --config-file string path of the configuration file to start up
-h, --help help for mxdr
-s, --shard-cnt int number of shards of the source database cluster
-v, --version version for mxdr
mxbox deployer dr
mxbox deployer dr 用于部署灾难恢复组件和备份集群。
Usage:
mxbox deployer dr [command]
Available Commands:
pub Publisher deployer for dr
Flags:
-h, --help help for dr
Usage:
mxbox deployer dr pub [command]
Available Commands:
config Generate a config template file
plan Generate plan for migrating host.
setup Execute steps to deploy physical publisher.
Flags:
-h, --help help for pub