The following functions enable you to control the mode which a replication group is running in, either single-primary or multi-primary mode.以下功能使您能够控制复制组运行的模式,即单主模式或多主模式。
group_replication_switch_to_single_primary_mode()
Changes a group running in multi-primary mode to single-primary mode, without the need to stop Group Replication. 将以多主模式运行的组更改为单主模式,而无需停止组复制。Must be issued on a member of a replication group running in multi-primary mode. 必须对以多主模式运行的复制组的成员发出。When you change to single-primary mode, strict consistency checks are also disabled on all group members, as required in single-primary mode (当您切换到单主模式时,所有组成员上的严格一致性检查也将根据单主模式的要求禁用(group_replication_enforce_update_everywhere_checks=OFF
).group_replication_enforce_update_everywhere_checks=OFF
)。
Syntax:语法:
STRING group_replication_switch_to_single_primary_mode([str
])
Arguments:参数:
str
: A string containing the UUID of a member of the group which should become the new single primary. Other members of the group become secondaries.:包含组成员的UUID的字符串,该组应成为新的单个主组。小组中的其他成员成为次要成员。
Return value:返回值:
A string containing the result of the operation, for example whether it was successful or not.包含操作结果的字符串,例如操作是否成功。
Example:例子:
SELECT group_replication_switch_to_single_primary_mode(member_uuid
);
For more information, see Section 18.5.1.2, “Changing a Group's Mode”有关更多信息,请参阅第18.5.1.2节,“更改组模式”。
group_replication_switch_to_multi_primary_mode()
Changes a group running in single-primary mode to multi-primary mode. 将以单主模式运行的组更改为多主模式。Must be issued on a member of a replication group running in single-primary mode.必须对以单一主模式运行的复制组的成员发出。
Syntax:语法:
STRING group_replication_switch_to_multi_primary_mode()
This function has no parameters.此函数没有参数。
Return value:返回值:
A string containing the result of the operation, for example whether it was successful or not.包含操作结果的字符串,例如操作是否成功。
Example:例子:
SELECT group_replication_switch_to_multi_primary_mode()
All members which belong to the group become primaries.属于该团体的所有成员都成为初选成员。
For more information, see Section 18.5.1.2, “Changing a Group's Mode”有关更多信息,请参阅第18.5.1.2节,“更改组模式”。