8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 20 组复制 / 20.1 组复制背景 / 20.1.3 多主模式和单主模式
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

20.1.3 多主模式和单主模式20.1.3 Multi-Primary and Single-Primary Modes

组复制以单主模式或多主模式运行。组的模式是一个组范围的配置设置,由 group_replication_single_primary_mode 系统变量指定,该变量在所有成员中必须相同。ON 表示单主模式,这是默认模式,OFF 表示多主模式。组成员不能部署在不同模式中,例如,一个成员配置为多主模式,而另一个成员为单主模式,这是不可能的。Group Replication operates either in single-primary mode or in multi-primary mode. The group's mode is a group-wide configuration setting, specified by the group_replication_single_primary_mode system variable, which must be the same on all members. ON means single-primary mode, which is the default mode, and OFF means multi-primary mode. It is not possible to have members of the group deployed in different modes, for example one member configured in multi-primary mode while another member is in single-primary mode.

在 Group Replication 运行时,您无法手动更改 group_replication_single_primary_mode 的值。您可以使用 group_replication_switch_to_single_primary_mode() 和 group_replication_switch_to_multi_primary_mode() 函数在 Group Replication 仍在运行时将一个组从一种模式切换到另一种模式。这些函数管理更改组模式的过程,并确保数据的安全性和一致性。在早期版本中,要更改组的模式,必须停止 Group Replication 并在所有成员上更改 group_replication_single_primary_mode 的值。然后对该组进行完整重启(由设置了 group_replication_bootstrap_group=ON 的服务器引导)以实施新的操作配置。您不需要重新启动服务器。You cannot change the value of group_replication_single_primary_mode manually while Group Replication is running. You can use the group_replication_switch_to_single_primary_mode() and group_replication_switch_to_multi_primary_mode() functions to move a group from one mode to another while Group Replication is still running. These functions manage the process of changing the group's mode and ensure the safety and consistency of your data. In earlier releases, to change the group's mode you must stop Group Replication and change the value of group_replication_single_primary_mode on all members. Then carry out a full reboot of the group (a bootstrap by a server with group_replication_bootstrap_group=ON) to implement the change to the new operating configuration. You do not need to restart the servers.

无论部署模式如何,组复制不处理客户端故障转移。客户端故障转移必须由中间件框架处理,例如MySQL Router 8.4、代理、连接器或应用程序本身。Regardless of the deployed mode, Group Replication does not handle client-side failover. That must be handled by a middleware framework such as MySQL Router 8.4, a proxy, a connector, or the application itself.