The following functions enable you to inspect and configure the Group Replication communication protocol version that is used by a replication group.以下功能使您能够检查和配置复制组使用的组复制通信协议版本。
group_replication_get_communication_protocol()
Inspect the Group Replication communication protocol version that is currently in use for a group.检查组当前正在使用的组复制通信协议版本。
Syntax:语法:
STRING group_replication_get_communication_protocol()
This function has no parameters.此函数没有参数。
Return value:返回值:
The oldest MySQL Server version that can join this group and use the group's communication protocol. Versions from MySQL 5.7.14 allow compression of messages, and versions from MySQL 8.0.16 also allow fragmentation of messages. 可以加入此组并使用组通信协议的最早MySQL服务器版本。MySQL 5.7.14版本允许对消息进行压缩,MySQL 8.0.16版本也允许对消息进行分段。Note that the 请注意,group_replication_get_communication_protocol()
function returns the minimum MySQL version that the group supports, which might differ from the version number that was passed to the group_replication_set_communication_protocol()
function, and from the MySQL Server version that is installed on the member where you use the function.group_replication_get_communication_protocol()
函数返回组支持的最低MySQL版本,这可能与传递给group_replication_set_communication_protocol()
函数的版本号不同,也可能与使用该函数的成员上安装的MySQL服务器版本不同。
If the protocol cannot be inspected because this server instance does not belong to a replication group, an error is returned as a string.如果由于此服务器实例不属于复制组而无法检查协议,则会以字符串形式返回错误。
Example:例子:
SELECT group_replication_get_communication_protocol();
+------------------------------------------------+
| group_replication_get_communication_protocol() |
+------------------------------------------------+
| 8.0.16 |
+------------------------------------------------+
For more information, see Section 18.5.1.4, “Setting a Group's Communication Protocol Version”.有关更多信息,请参阅第18.5.1.4节,“设置组的通信协议版本”。
group_replication_set_communication_protocol()
Downgrade the Group Replication communication protocol version of a group so that members at earlier releases can join, or upgrade the Group Replication communication protocol version of a group after upgrading MySQL Server on all members. 降级组的组复制通信协议版本,以便早期版本的成员可以加入,或者在升级所有成员上的MySQL Server后升级组的组复制通信协议版本。The 使用此功能需要GROUP_REPLICATION_ADMIN
privilege is required to use this function, and all existing group members must be online when you issue the statement, with no loss of majority.GROUP_REPLICATION_ADMIN
权限,并且在发出声明时,所有现有的GROUP成员都必须在线,且不会失去多数。
For MySQL InnoDB cluster, the communication protocol version is managed automatically whenever the cluster topology is changed using AdminAPI operations. 对于MySQL InnoDB
群集,只要使用AdminAPI操作更改群集拓扑,就会自动管理通信协议版本。You do not have to use these functions yourself for an InnoDB cluster.对于InnoDB
集群,您不必自己使用这些函数。
Syntax:语法:
STRING group_replication_set_communication_protocol(version
)
Arguments:参数:
version
: For a downgrade, specify the MySQL Server version of the prospective group member that has the oldest installed server version. :对于降级,请指定具有最旧安装服务器版本的预期组成员的MySQL服务器版本。In this case, the command makes the group fall back to a communication protocol compatible with that server version if possible. 在这种情况下,如果可能,该命令将使组退回到与该服务器版本兼容的通信协议。The minimum server version that you can specify is MySQL 5.7.14. 您可以指定的最低服务器版本是MySQL 5.7.14。For an upgrade, specify the new MySQL Server version to which the existing group members have been upgraded.对于升级,请指定现有组成员已升级到的新MySQL服务器版本。
Return value:返回值:
A string containing the result of the operation, for example whether it was successful or not.包含操作结果的字符串,例如操作是否成功。
Example:例子:
SELECT group_replication_set_communication_protocol("5.7.25");
For more information, see Section 18.5.1.4, “Setting a Group's Communication Protocol Version”.有关更多信息,请参阅第18.5.1.4节,“设置组的通信协议版本”。