8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

20.5.1 配置在线组20.5.1 Configuring an Online Group

在 Group Replication 运行时,您可以使用一组依赖于组操作协调器的函数来配置在线组。这些函数由 Group Replication 插件安装。本节介绍了如何对运行中的组进行更改以及可用的函数。You can configure an online group while Group Replication is running by using a set of functions, which rely on a group action coordinator. These functions are installed by the Group Replication plugin. This section describes how changes are made to a running group, and the available functions.

Important

为了使协调器能够在运行中的组上配置全组操作,所有成员必须安装这些函数。For the coordinator to be able to configure group wide actions on a running group, all members must have the functions installed.

要使用这些功能,请连接到正在运行组的成员,并使用 SELECT 语句调用该函数。Group Replication 插件会处理该操作及其参数,协调者会将其发送给在你调用函数时对该成员可见的所有成员。如果操作被接受,所有成员都会执行该操作,并在完成后发送终止消息。一旦所有成员声明操作完成,调用成员会将结果返回给客户端。To use the functions, connect to a member of the running group and invoke the function with the SELECT statement. The Group Replication plugin processes the action and its parameters and the coordinator sends it to all members which are visible to the member where you invoked the function. If the action is accepted, all members execute the action and send a termination message when completed. Once all members declare the action as finished, the invoking member returns the result to the client.

在配置整个组时,由于操作的分布式特性,它们会与 Group Replication 插件的多个进程交互,因此你应注意以下事项:When configuring a whole group, the distributed nature of the operations means that they interact with many processes of the Group Replication plugin, and therefore you should observe the following:

您可以在任何地方执行配置操作。 如果您想将成员 A 设置为新的主节点,不需要在成员 A 上执行该操作。所有操作都会以协调的方式发送并在所有组成员上执行。此外,这种操作的分布式执行有一个不同的影响:如果调用操作的成员宕机,任何已经在运行的配置过程会继续在其他成员上运行。在调用操作的成员意外宕机的极少数情况下,您仍然可以使用监控功能确保其他成员成功完成操作。You can issue configuration operations everywhere.  If you want to make member A the new primary you do not need to invoke the operation on member A. All operations are sent and executed in a coordinated way on all group members. Also, this distributed execution of an operation has a different ramification: if the invoking member dies, any already running configuration process continues to run on other members. In the unlikely event that the invoking member dies, you can still use the monitoring features to ensure other members complete the operation successfully.

所有成员必须在线。 为了简化迁移或选举过程并确保它们尽可能快,组中不得包含任何当前处于分布式恢复过程的成员,否则在您发出语句的成员上,配置操作将被拒绝。All members must be online.  To simplify the migration or election processes and guarantee they are as fast as possible, the group must not contain any member currently in the distributed recovery process, otherwise the configuration action is rejected by the member where you issue the statement.

在配置更改期间,任何成员都不能加入组。 在协调配置更改期间尝试加入组的任何成员将离开组并取消其加入过程。No members can join a group during a configuration change.  Any member that attempts to join the group during a coordinated configuration change leaves the group and cancels its join process.

一次仅允许一个配置。 正在执行配置更改的组无法接受任何其他组配置更改,因为并发配置操作可能导致成员分歧。Only one configuration at once.  A group which is executing a configuration change cannot accept any other group configuration change, because concurrent configuration operations could lead to member divergence.