关于 YMatrix
部署数据库
使用数据库
管理集群
最佳实践
高级功能
高级查询
资源组
联邦查询
Grafana 监控
备份恢复
灾难恢复
管理手册
性能调优
故障诊断
工具指南
系统配置参数
SQL 参考
当灾难发生时,若主集群侧所有机器物理不可用,此时用户只能在备份集群侧进行操作。
主备切换完成后,备份集群的数据内容不在与主集群保持一致,且无法再次切换回备份集群角色。
在备份集群的 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