本节列出了特定于 Group Replication 插件的系统变量。This section lists the system variables that are specific to the Group Replication plugin.
每个 Group Replication 系统变量的名称都以 group_replication_ 为前缀。The name of each Group Replication system variable is prefixed
with group_replication_.
InnoDB 集群使用组复制,但组复制系统变量的默认值可能与本节中记录的默认值不同。例如,在 InnoDB 集群中,group_replication_communication_stack 的默认值是 MYSQL,而不是默认组复制实现中的 XCOM。InnoDB Cluster uses Group Replication, but the default values
of the Group Replication system variables may differ from the
defaults documented in this section. For example, in
InnoDB Cluster, the default value of
group_replication_communication_stack
is MYSQL, not XCOM as it
is for a default Group Replication implementation.
有关更多信息,请参阅 MySQL InnoDB 集群。For more information, see MySQL InnoDB Cluster.
在组复制组成员上的一些系统变量,包括一些组复制特定的系统变量和一些通用系统变量,是全组配置设置。这些系统变量在所有组成员上必须具有相同的值,并且需要对整个组进行完全重启(由具有 group_replication_bootstrap_group=ON 的服务器引导)才能使值更改生效。有关重新启动所有成员已停止的组的说明,请参见 第 20.5.2 节,“重新启动组”。Some system variables on a Group Replication group member,
including some Group Replication-specific system variables and
some general system variables, are group-wide configuration
settings. These system variables must have the same value on all
group members, and require a full reboot of the group (a bootstrap
by a server with
group_replication_bootstrap_group=ON)
in order for the value change to take effect. For instructions to
reboot a group where every member has been stopped, see
Section 20.5.2, “Restarting a Group”.
如果一个运行组为组级配置设置了一个值,而加入的成员在该系统变量上有不同的设置值,则该成员必须将值更改为匹配的值才能加入该组。如果该组为这些系统变量之一设置了值,而加入的成员不支持该系统变量,则它无法加入该组。If a running group has a value set for a group-wide configuration setting, and a joining member has a different value set for that system variable, the joining member cannot join the group until the value is changed to match. If the group has a value set for one of these system variables, and the joining member does not support the system variable, it cannot join the group.
以下系统变量是组级配置设置:The following system variables are group-wide configuration settings:
group_replication_view_change_uuid(已弃用)group_replication_view_change_uuid(deprecated)group_replication_communication_stack(一种特殊情况,不受 Group Replication 自身检查的限制;详情请参见系统变量描述)group_replication_communication_stack(a special case not policed by Group Replication's own checks; see the system variable description for details)
当组复制正在运行时,无法通过常规方法更改整个组的配置设置,但可以使用 group_replication_switch_to_single_primary_mode() 和 group_replication_switch_to_multi_primary_mode() 函数在组仍在运行时更改 group_replication_single_primary_mode 和 group_replication_enforce_update_everywhere_checks 的值。更多信息,请参见 第 20.5.1.2 节,“更改组模式”。Group-wide configuration settings cannot be changed by the usual
methods while Group Replication is running, but it is possible to
use the
group_replication_switch_to_single_primary_mode()
and
group_replication_switch_to_multi_primary_mode()
functions to change the values of
group_replication_single_primary_mode
and
group_replication_enforce_update_everywhere_checks
while the group is still running. For more information, see
Section 20.5.1.2, “Changing the Group Mode”.
组复制的大多数系统变量在不同的组成员上可以有不同的值。对于以下系统变量,建议在组的所有成员上设置相同的值,以避免不必要的事务回滚、消息传递失败或消息恢复失败:Most system variables for Group Replication can have different values on different group members. For the following system variables, it is advisable to set the same value on all members of a group in order to avoid unnecessary rollback of transactions, failure of message delivery, or failure of message recovery:
group_replication_preemptive_garbage_collection 的值必须在所有组成员上相同。The value of
group_replication_preemptive_garbage_collection
must be the same on all group members.
大多数组复制的系统变量被描述为动态的,其值可以在服务器运行时更改。然而,在大多数情况下,只有在使用STOP GROUP_REPLICATION语句停止组成员上的组复制,然后使用START
GROUP_REPLICATION语句重新启动后,修改才会生效。以下系统变量的更改无需停止和重新启动组复制即可生效:Most system variables for Group Replication are described as
dynamic, and their values can be changed while the server is
running. However, in most cases, the change takes effect only
after you stop and restart Group Replication on the group member
using a STOP GROUP_REPLICATION
statement followed by a START
GROUP_REPLICATION statement. Changes to the following
system variables take effect without stopping and restarting Group
Replication:
当你更改任何组复制系统变量的值时,请记住,如果出现一种情况,即通过STOP GROUP_REPLICATION 语句或系统关闭导致每个成员上的组复制同时停止,则必须通过引导重新启动该组,就像首次启动一样。有关如何安全执行此操作的说明,请参阅第 20.5.2 节,“重新启动组”。对于组范围的配置设置,这是必需的,但如果你更改其他设置,请尽量确保至少有一个成员始终在运行。When you change the values of any Group Replication system
variables, bear in mind that if there is a point where Group
Replication is stopped on every member at once by a
STOP GROUP_REPLICATION statement or
system shutdown, the group must be restarted by bootstrapping as
if it was being started for the first time. For instructions on
doing this safely, see
Section 20.5.2, “Restarting a Group”. In the case
of group-wide configuration settings, this is required, but if you
are changing other settings, try to ensure that at least one
member is running at all times.
如果在服务器启动时将某些系统变量作为命令行参数传递给服务器,Group Replication 的一些系统变量在服务器启动期间不会被完全验证。这些系统变量包括
group_replication_group_name、group_replication_single_primary_mode、group_replication_force_members、SSL 变量以及流量控制系统变量。它们只有在服务器启动后才会被完全验证。A number of system variables for Group Replication are not completely validated during server startup if they are passed as command line arguments to the server. These system variables includegroup_replication_group_name,group_replication_single_primary_mode,group_replication_force_members, the SSL variables, and the flow control system variables. They are fully validated only after the server has started.指定组成员的 IP 地址或主机名的组复制系统变量在发出
START GROUP_REPLICATION语句之前不会被验证。组复制的组通信系统(GCS)在此之前无法验证这些值。System variables for Group Replication that specify IP addresses or host names for group members are not validated until aSTART GROUP_REPLICATIONstatement is issued. Group Replication's Group Communication System (GCS) is not available to validate the values until that point.
与组复制插件相关的服务器系统变量及其功能或用途描述如下:Server system variables specific to the Group Replication plugin, along with descriptions of their function or purpose, are listed here:
group_replication_advertise_recovery_endpoints命令行格式Command-Line Format --group-replication-advertise-recovery-endpoints=value系统变量System Variable group_replication_advertise_recovery_endpoints范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 默认值Default Value DEFAULTDEFAULT在组复制运行期间,可以更改此系统变量的值。更改会立即在当前成员上生效。然而,已经收到系统变量先前值的加入成员将继续使用该值。只有在值更改后加入的成员才会接收新值。The value of this system variable can be changed while Group Replication is running. The change takes effect immediately on the member. However, a joining member that already received the previous value of the system variable continues to use that value. Only members that join after the value change receive the new value.
group_replication_advertise_recovery_endpoints指定了加入成员如何建立与现有成员的连接,以进行分布式恢复的状态传输。该连接用于远程克隆操作以及从捐献者的二进制日志进行的状态传输。group_replication_advertise_recovery_endpointsspecifies how a joining member can establish a connection to an existing member for state transfer for distributed recovery. The connection is used for both remote cloning operations and state transfer from the donor's binary log.值为
DEFAULT,即默认设置,表示加入的成员使用现有成员的标准 SQL 客户端连接,如 MySQL 服务器的hostname和port系统变量所指定。如果通过report_port系统变量指定了替代的端口号,则使用该端口号。Performance Schema 表replication_group_members在MEMBER_HOST和MEMBER_PORT列中显示此连接的地址和端口号。A value ofDEFAULT, which is the default setting, means joining members use the existing member's standard SQL client connection, as specified by MySQL Server'shostnameandportsystem variables. If an alternative port number is specified by thereport_portsystem variable, that one is used instead. The Performance Schema tablereplication_group_membersshows this connection's address and port number in theMEMBER_HOSTandMEMBER_PORTcolumns.你可以指定一个或多个分布式恢复端点,而不是使用
DEFAULT,现有成员会向加入的成员宣传这些端点以供使用。提供分布式恢复端点可以让管理员将分布式恢复流量与普通 MySQL 客户端连接到组成员的流量分别控制。加入的成员会按列表中指定的顺序依次尝试每一个端点。Instead ofDEFAULT, you can specify one or more distributed recovery endpoints, which the existing member advertises to joining members for them to use. Offering distributed recovery endpoints lets administrators control distributed recovery traffic separately from regular MySQL client connections to the group members. Joining members try each of the endpoints in turn in the order they are specified on the list.将分布式恢复端点指定为逗号分隔的 IP 地址和端口号列表,例如:Specify the distributed recovery endpoints as a comma-separated list of IP addresses and port numbers, for example:
group_replication_advertise_recovery_endpoints= "127.0.0.1:3306,127.0.0.1:4567,[::1]:3306,localhost:3306"
IPv4 和 IPv6 地址以及主机名可以任意组合使用。IPv6 地址必须用方括号括起来。主机名必须解析为本地 IP 地址。不能使用通配符地址格式,也不能指定空列表。请注意,标准 SQL 客户端连接不会自动包含在分布式恢复端点列表中。如果您想将其用作端点,必须在列表中明确包含它。IPv4 and IPv6 addresses and host names can be used in any combination. IPv6 addresses must be specified in square brackets. Host names must resolve to a local IP address. Wildcard address formats cannot be used, and you cannot specify an empty list. Note that the standard SQL client connection is not automatically included on a list of distributed recovery endpoints. If you want to use it as an endpoint, you must include it explicitly on the list.
有关如何选择 IP 地址和端口作为分布式恢复端点,以及加入成员如何使用它们的详细信息,请参见 第 20.5.4.1.1 节,“选择分布式恢复端点的地址”。要求总结如下:For details of how to select IP addresses and ports as distributed recovery endpoints, and how joining members use them, see Section 20.5.4.1.1, “Selecting addresses for distributed recovery endpoints”. A summary of the requirements is as follows:
MySQL 服务器不必配置 IP 地址,但必须将其分配给服务器。The IP addresses do not have to be configured for MySQL Server, but they do have to be assigned to the server.
必须使用
port、report_port或admin_port系统变量为 MySQL 服务器配置端口。The ports do have to be configured for MySQL Server using theport,report_port, oradmin_portsystem variable.如果使用
admin_port,则分布式恢复的复制用户需要具备适当的权限。Appropriate permissions are required for the replication user for distributed recovery if theadmin_portis used.这些 IP 地址无需添加到由
group_replication_ip_allowlist系统变量指定的组复制允许列表中。The IP addresses do not need to be added to the Group Replication allowlist specified by thegroup_replication_ip_allowlistsystem variable.连接的 SSL 要求由
group_replication_recovery_ssl_*选项指定。The SSL requirements for the connection are as specified by thegroup_replication_recovery_ssl_*options.
group_replication_allow_local_lower_version_join命令行格式Command-Line Format --group-replication-allow-local-lower-version-join[={OFF|ON}]已弃用Deprecated 是Yes 系统变量System Variable group_replication_allow_local_lower_version_join范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFF此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_allow_local_lower_version_join允许当前服务器加入组,即使它运行的 MySQL 服务器版本低于组中的其他成员。默认设置为OFF时,如果服务器运行的版本低于现有组成员,则不允许其加入复制组。这一标准策略确保组内的所有成员能够交换消息和应用事务。group_replication_allow_local_lower_version_joinallows the current server to join the group even if it is running a lower MySQL Server version than the group. With the default settingOFF, servers are not permitted to join a replication group if they are running a lower version than the existing group members. This standard policy ensures that all members of a group are able to exchange messages and apply transactions.仅在以下情况下将
group_replication_allow_local_lower_version_join设置为ON:Setgroup_replication_allow_local_lower_version_jointoONonly in the following scenarios:必须在紧急情况下将服务器添加到组中以提高组的容错能力,并且只有旧版本可用。A server must be added to the group in an emergency in order to improve the group's fault tolerance, and only older versions are available.
您希望回滚一个或多个复制组成员的升级,而无需关闭整个组并重新引导它。You want to roll back an upgrade for one or more replication group members without shutting down the whole group and bootstrapping it again.
Warning将此选项设置为
ON并不会使新成员与组兼容,而且允许它加入组而不对现有成员的不兼容行为采取任何防护措施。为了确保新成员的正确操作,请采取以下 两个 预防措施:Setting this option toONdoes not make the new member compatible with the group, and allows it to join the group without any safeguards against incompatible behaviors by the existing members. To ensure the new member's correct operation, take both of the following precautions:在运行较低版本的服务器加入组之前,停止该服务器上的所有写操作。Before the server running the lower version joins the group, stop all writes on that server.
从运行较低版本的服务器加入组开始,停止组内其他服务器上的所有写操作。From the point where the server running the lower version joins the group, stop all writes on the other servers in the group.
如果没有这些预防措施,运行低版本的服务器可能会遇到困难并带着错误终止。Without these precautions, the server running the lower version is likely to experience difficulties and terminate with an error.
group_replication_auto_increment_increment命令行格式Command-Line Format --group-replication-auto-increment-increment=#系统变量System Variable group_replication_auto_increment_increment范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 7最小值Minimum Value 1最大值Maximum Value 65535此系统变量在所有组成员上应具有相同的值。在组复制运行时,您无法更改此系统变量的值。您必须停止组复制,更改系统变量的值,然后在每个组成员上重新启动组复制。在此过程中,系统变量的值允许在组成员之间有所不同,但组成员上的某些事务可能会被回滚。This system variable should have the same value on all group members. You cannot change the value of this system variable while Group Replication is running. You must stop Group Replication, change the value of the system variable, then restart Group Replication, on each of the group members. During this process, the value of the system variable is permitted to differ between group members, but some transactions on group members might be rolled back.
group_replication_auto_increment_increment决定在此服务器实例上执行的事务的自增列连续值之间的间隔。增加间隔可以避免在组成员上写入时选择重复的自增值,从而导致事务回滚。默认值 7 代表可用值的数量与允许的复制组最大规模(9 个成员)之间的平衡。如果您的组成员数量更多或更少,可以在启动组复制之前将此系统变量设置为匹配预期的组成员数量。group_replication_auto_increment_incrementdetermines the interval between successive values for auto-incremented columns for transactions that execute on this server instance. Adding an interval avoids the selection of duplicate auto-increment values for writes on group members, which causes rollback of transactions. The default value of 7 represents a balance between the number of usable values and the permitted maximum size of a replication group (9 members). If your group has more or fewer members, you can set this system variable to match the expected number of group members before Group Replication is started.Important当
group_replication_single_primary_mode为ON时,设置group_replication_auto_increment_increment无效。Settinggroup_replication_auto_increment_incrementhas no effect whengroup_replication_single_primary_modeisON.当在服务器实例上启动群组复制(Group Replication)时,服务器系统变量
auto_increment_increment的值会被更改为此值,服务器系统变量auto_increment_offset的值会被更改为服务器 ID。当群组复制停止时,这些更改会恢复。只有在auto_increment_increment和auto_increment_offset的值都为默认值 1 时,这些更改才会被执行和恢复。如果它们的值已经被修改过,群组复制不会更改它们。当群组复制处于单主模式(single-primary mode),即只有一台服务器写入时,这些系统变量也不会被修改。When Group Replication is started on a server instance, the value of the server system variableauto_increment_incrementis changed to this value, and the value of the server system variableauto_increment_offsetis changed to the server ID. The changes are reverted when Group Replication is stopped. These changes are only made and reverted ifauto_increment_incrementandauto_increment_offseteach have their default value of 1. If their values have already been modified from the default, Group Replication does not alter them. The system variables are also not modified when Group Replication is in single-primary mode, where only one server writes.group_replication_autorejoin_tries命令行格式Command-Line Format --group-replication-autorejoin-tries=#系统变量System Variable group_replication_autorejoin_tries范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 3最小值Minimum Value 0最大值Maximum Value 2016在组复制运行期间,可以更改此系统变量的值,并且更改会立即生效。当发生需要该行为的问题时,会读取该系统变量的当前值。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately. The system variable's current value is read when an issue occurs that means the behavior is needed.
group_replication_autorejoin_tries指定了当成员被开除,或者在达到group_replication_unreachable_majority_timeout设置值之前无法联系到群体大多数成员时,成员尝试自动重新加入群体的次数。当成员被开除或不可达多数超时达到时,它会尝试重新加入(使用当前插件选项值),然后继续进行进一步的自动重新加入尝试,直到达到指定的尝试次数。在自动重新加入尝试失败后,成员会在下一次尝试前等待 5 分钟。如果在耗尽指定尝试次数后成员仍未重新加入或被停止,成员将执行由group_replication_exit_state_action系统变量指定的操作。group_replication_autorejoin_triesspecifies the number of tries that a member makes to automatically rejoin the group if it is expelled, or if it is unable to contact a majority of the group before thegroup_replication_unreachable_majority_timeoutsetting is reached. When the member's expulsion or unreachable majority timeout is reached, it makes an attempt to rejoin (using the current plugin option values), then continues to make further auto-rejoin attempts up to the specified number of tries. After an unsuccessful auto-rejoin attempt, the member waits 5 minutes before the next try. If the specified number of tries is exhausted without the member rejoining or being stopped, the member proceeds to the action specified by thegroup_replication_exit_state_actionsystem variable.在自动重新加入尝试期间和尝试之间,成员保持超级只读模式,不接受写入,但仍可以在该成员上进行读取,随着时间推移,陈旧读取的可能性会增加。如果您无法容忍任何时间段内可能出现的陈旧读取,请将
group_replication_autorejoin_tries设置为 0。有关自动重新加入功能的更多信息,以及选择此选项值时的注意事项,请参见 第 20.7.7.3 节,“自动重新加入”。During and between auto-rejoin attempts, a member remains in super read only mode and does not accept writes, but reads can still be made on the member, with an increasing likelihood of stale reads over time. If you cannot tolerate the possibility of stale reads for any period of time, setgroup_replication_autorejoin_triesto 0. For more information on the auto-rejoin feature, and considerations when choosing a value for this option, see Section 20.7.7.3, “Auto-Rejoin”.group_replication_bootstrap_group命令行格式Command-Line Format --group-replication-bootstrap-group[={OFF|ON}]系统变量System Variable group_replication_bootstrap_group范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFFgroup_replication_bootstrap_group配置此服务器以引导该组。此系统变量必须仅在一台服务器上设置,并且仅在首次启动组或重新启动整个组时设置。组引导完成后,将此选项设置为OFF。它应该在动态设置和配置文件中都设置为OFF。在组运行期间,如果启动两台服务器或重启一台服务器,并且设置了此选项,可能导致人为的脑裂情况,即两个独立的具有相同名称的组被引导。group_replication_bootstrap_groupconfigures this server to bootstrap the group. This system variable must only be set on one server, and only when starting the group for the first time or restarting the entire group. After the group has been bootstrapped, set this option toOFF. It should be set toOFFboth dynamically and in the configuration files. Starting two servers or restarting one server with this option set while the group is running may lead to an artificial split brain situation, where two independent groups with the same name are bootstrapped.有关首次引导群组的说明,请参见 第 20.2.1.5 节,“引导群组”。有关在已经执行并认证事务的情况下安全引导群组的说明,请参见 第 20.5.2 节,“重新启动群组”。For instructions to bootstrap a group for the first time, see Section 20.2.1.5, “Bootstrapping the Group”. For instructions to safely bootstrap a group where transactions have been executed and certified, see Section 20.5.2, “Restarting a Group”.
group_replication_clone_threshold命令行格式Command-Line Format --group-replication-clone-threshold=#系统变量System Variable group_replication_clone_threshold范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 9223372036854775807最小值Minimum Value 1最大值Maximum Value 9223372036854775807单位Unit 事务transactions 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_clone_threshold指定在分布式恢复过程中,用于触发向加入成员传输状态的远程克隆操作时,现有成员(提供者)与加入成员(接收者)之间的事务差距(以事务数量计)。如果加入成员与合适的提供者之间的事务差距超过阈值,组复制将开始使用远程克隆操作进行分布式恢复。如果事务差距低于阈值,或者远程克隆操作在技术上不可行,组复制将直接从提供者的二进制日志进行状态传输。group_replication_clone_thresholdspecifies the transaction gap, as a number of transactions, between the existing member (donor) and the joining member (recipient) that triggers the use of a remote cloning operation for state transfer to the joining member during the distributed recovery process. If the transaction gap between the joining member and a suitable donor exceeds the threshold, Group Replication begins distributed recovery with a remote cloning operation. If the transaction gap is below the threshold, or if the remote cloning operation is not technically possible, Group Replication proceeds directly to state transfer from a donor's binary log.Warning在一个活动的组中,不要对
group_replication_clone_threshold使用较低的设置。如果在远程克隆操作进行期间,组内发生的事务数量超过阈值,加入的成员在重启后会再次触发远程克隆操作,并可能无限期地继续这样。为了避免这种情况,请确保将阈值设置为高于在远程克隆操作所需时间内预期发生的事务数量。Do not use a low setting forgroup_replication_clone_thresholdin an active group. If a number of transactions above the threshold takes place in the group while the remote cloning operation is in progress, the joining member triggers a remote cloning operation again after restarting, and could continue this indefinitely. To avoid this situation, ensure that you set the threshold to a number higher than the number of transactions that you would expect to occur in the group during the time taken for the remote cloning operation.要使用此功能,必须事先设置捐赠者和加入的成员以支持克隆。有关说明,请参见 第 20.5.4.2 节,“分布式恢复的克隆”。当执行远程克隆操作时,如果设置了
group_replication_start_on_boot=ON,Group Replication 会为您管理此操作,包括所需的服务器重启。如果未设置,您必须手动重启服务器。远程克隆操作会替换加入成员上现有的数据字典,但如果加入成员具有其他组成员中不存在的额外事务,Group Replication 会进行检查并且不会继续操作,因为这些事务将在克隆操作中被删除。To use this function, both the donor and the joining member must be set up beforehand to support cloning. For instructions, see Section 20.5.4.2, “Cloning for Distributed Recovery”. When a remote cloning operation is carried out, Group Replication manages it for you, including the required server restart, provided thatgroup_replication_start_on_boot=ONis set. If not, you must restart the server manually. The remote cloning operation replaces the existing data dictionary on the joining member, but Group Replication checks and does not proceed if the joining member has additional transactions that are not present on the other group members, because these transactions would be erased by the cloning operation.默认设置(即 GTID 中事务允许的最大序列号)意味着几乎总是尝试从捐赠者的二进制日志进行状态传输,而不是克隆。然而,请注意,如果无法从捐赠者的二进制日志进行状态传输,例如因为加入成员所需的事务在任何现有组成员的二进制日志中都不可用,Group Replication 总是会尝试执行克隆操作,而不考虑您的阈值。如果您完全不想在复制组中使用克隆,请不要在成员上安装克隆插件。The default setting (which is the maximum permitted sequence number for a transaction in a GTID) means that state transfer from a donor's binary log is virtually always attempted rather than cloning. However, note that Group Replication always attempts to execute a cloning operation, regardless of your threshold, if state transfer from a donor's binary log is impossible, for example because the transactions needed by the joining member are not available in the binary logs on any existing group member. If you do not want to use cloning at all in your replication group, do not install the clone plugin on the members.
group_replication_communication_debug_options命令行格式Command-Line Format --group-replication-communication-debug-options=value--group-replication-communication-debug-options=value系统变量System Variable group_replication_communication_debug_options范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 默认值Default Value GCS_DEBUG_NONE有效值Valid Values GCS_DEBUG_NONEGCS_DEBUG_BASICGCS_DEBUG_TRACEXCOM_DEBUG_BASICXCOM_DEBUG_TRACEGCS_DEBUG_ALL在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_communication_debug_options配置为不同的组复制组件(如组通信系统(GCS)和组通信引擎(XCom,一种 Paxos 变体))提供调试消息的级别。调试信息存储在数据目录中的GCS_DEBUG_TRACE文件中。group_replication_communication_debug_optionsconfigures the level of debugging messages to provide for the different Group Replication components, such as the Group Communication System (GCS) and the group communication engine (XCom, a Paxos variant). The debug information is stored in theGCS_DEBUG_TRACEfile in the data directory.可用选项集以字符串形式指定,可以组合使用。可用的选项如下:The set of available options, specified as strings, can be combined. The following options are available:
GCS_DEBUG_NONE禁用 GCS 和 XCom 的所有调试级别。GCS_DEBUG_NONEdisables all debugging levels for both GCS and XCom.GCS_DEBUG_BASIC启用 GCS 中的基本调试信息。GCS_DEBUG_BASICenables basic debugging information in GCS.GCS_DEBUG_TRACE启用 GCS 中的跟踪信息。GCS_DEBUG_TRACEenables trace information in GCS.XCOM_DEBUG_BASIC在 XCom 中启用基本调试信息。XCOM_DEBUG_BASICenables basic debugging information in XCom.XCOM_DEBUG_TRACE在 XCom 中启用跟踪信息。XCOM_DEBUG_TRACEenables trace information in XCom.GCS_DEBUG_ALL为 GCS 和 XCom 启用所有调试级别。GCS_DEBUG_ALLenables all debugging levels for both GCS and XCom.
将调试级别设置为
GCS_DEBUG_NONE仅在没有提供其他选项时才有效。将调试级别设置为GCS_DEBUG_ALL会覆盖所有其他选项。Setting the debug level toGCS_DEBUG_NONEonly has an effect when provided without any other option. Setting the debug level toGCS_DEBUG_ALLoverrides all other options.group_replication_communication_max_message_size命令行格式Command-Line Format --group-replication-communication-max-message-size=#系统变量System Variable group_replication_communication_max_message_size范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 10485760最小值Minimum Value 0最大值Maximum Value 1073741824单位Unit 字节bytes 此系统变量在所有组成员上应具有相同的值。在组复制运行时,您无法更改此系统变量的值。您必须停止组复制,更改系统变量的值,然后在每个组成员上重新启动组复制。在此过程中,系统变量的值允许在组成员之间有所不同,但组成员上的某些事务可能会被回滚。This system variable should have the same value on all group members. You cannot change the value of this system variable while Group Replication is running. You must stop Group Replication, change the value of the system variable, then restart Group Replication, on each of the group members. During this process, the value of the system variable is permitted to differ between group members, but some transactions on group members might be rolled back.
group_replication_communication_max_message_size指定了组复制通信的最大消息大小。大于此大小的消息将自动拆分为单独发送的片段,并由接收方重新组装。欲了解更多信息,请参见 第 20.7.5 节,“消息分片”。group_replication_communication_max_message_sizespecifies a maximum message size for Group Replication communications. Messages greater than this size are automatically split into fragments that are sent separately and reassembled by the recipients. For more information, see Section 20.7.5, “Message Fragmentation”.默认设置的最大消息大小为 10485760 字节(10 MiB),这意味着默认情况下使用分片。允许的最大值与系统变量
replica_max_allowed_packet的最大值相同,为 1073741824 字节(1 GB)。group_replication_communication_max_message_size必须小于replica_max_allowed_packet,因为应用线程无法处理大于允许的最大数据包大小的消息分片。要关闭分片,请将group_replication_communication_max_message_size设置为0。A maximum message size of 10485760 bytes (10 MiB) is set by default, which means that fragmentation is used by default. The greatest permitted value is the same as the maximum value of thereplica_max_allowed_packetsystem variable, which is 1073741824 bytes (1 GB).group_replication_communication_max_message_sizemust be less thanreplica_max_allowed_packet, because the applier thread cannot handle message fragments larger than the maximum permitted packet size. To switch off fragmentation, setgroup_replication_communication_max_message_sizeto0.为了让复制组的成员使用分片,该组的通信协议版本必须是 8.0.16 或更高版本。使用
group_replication_get_communication_protocol()函数查看组的通信协议版本。如果使用的是较低版本,组成员将不会对消息进行分片。如果所有组成员都支持更高版本,可以使用group_replication_set_communication_protocol()函数将组的通信协议设置为更高版本。更多信息,请参见 第 20.5.1.4 节,“设置组的通信协议版本”。In order for members of a replication group to use fragmentation, the group's communication protocol version must be 8.0.16 or later. Use thegroup_replication_get_communication_protocol()function to view the group's communication protocol version. If a lower version is in use, group members do not fragment messages. You can use thegroup_replication_set_communication_protocol()function to set the group's communication protocol to a higher version if all group members support it. For more information, see Section 20.5.1.4, “Setting a Group's Communication Protocol Version”.group_replication_communication_stack系统变量System Variable group_replication_communication_stack范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 默认值Default Value XCOM有效值Valid Values XCOMMYSQLNote这个系统变量实际上是一个全组范围的配置设置;虽然它可以在运行时设置,但任何更改都需要完整重启复制组才能生效。This system variable is effectively a group-wide configuration setting; although it can be set at runtime, a full reboot of the replication group is required for any change to take effect.
group_replication_communication_stack指定用于在成员之间建立组通信连接的是 XCom 通信栈还是 MySQL 通信栈。XCom 通信栈是 Group Replication 自己的实现,不支持身份验证或网络命名空间。MySQL 通信栈是 MySQL 服务器的原生实现,支持身份验证和网络命名空间,并且新安全功能在发布时即可使用。组内所有成员必须使用相同的通信栈。group_replication_communication_stackspecifies whether the XCom communication stack or the MySQL communication stack is to be used to establish group communication connections between members. The XCom communication stack is Group Replication's own implementation, and does not support authentication or network namespaces. The MySQL communication stack is MySQL Server's native implementation, with support for authentication and network namespaces, and access to new security functions immediately on release. All members of a group must use the same communication stack.当您使用 MySQL 通信栈代替 XCom 时,MySQL 服务器将使用其自己的身份验证和加密协议来建立组成员之间的每个连接。When you use the MySQL communication stack in place of XCom, MySQL Server establishes each connection between group members using its own authentication and encryption protocols.
Note如果您正在使用 InnoDB 集群,
group_replication_communication_stack的默认值是MYSQL。If you are using InnoDB Cluster, the default value ofgroup_replication_communication_stackisMYSQL.有关更多信息,请参阅 MySQL InnoDB 集群。For more information, see MySQL InnoDB Cluster.
当您设置一个组以使用 MySQL 的通信堆栈时,需要进行额外配置;请参见 第 20.6.1 节,“连接安全管理的通信堆栈”。Additional configuration is required when you set up a group to use MySQL’s communication stack; see Section 20.6.1, “Communication Stack for Connection Security Management”.
group_replication_communication_stack实际上是一个全组的配置设置,并且该设置必须在所有组成员上相同。然而,这一设置并不会受到 Group Replication 对全组配置设置自身检查的限制。与组中其他成员设置不同的成员根本无法与其他成员通信,因为通信协议不兼容,因此它无法交换有关其配置设置的信息。group_replication_communication_stackis effectively a group-wide configuration setting, and the setting must be the same on all group members. However, this is not policed by Group Replication’s own checks for group-wide configuration settings. A member with a different value from the rest of the group cannot communicate with the other members at all, because the communication protocols are incompatible, so it cannot exchange information about its configuration settings.这意味着,虽然在 Group Replication 正在运行时可以更改系统变量的值,并在您在该组成员上重新启动 Group Replication 后生效,但该成员在所有成员都更改设置之前仍然无法重新加入组。因此,您必须在所有成员上停止 Group Replication,并更改它们的系统变量值,然后才能重新启动组。由于所有成员都已停止,需要对组进行完全重启(由设置
group_replication_bootstrap_group=ON的服务器引导)以使值更改生效。有关从一个通信堆栈迁移到另一个通信堆栈的说明,请参见 第 20.6.1 节,“连接安全管理的通信堆栈”。This means that although the value of the system variable can be changed while Group Replication is running, and takes effect after you restart Group Replication on the group member, the member still cannot rejoin the group until the setting has been changed on all the members. You must therefore stop Group Replication on all of the members and change the value of the system variable on them all before you can restart the group. Because all of the members are stopped, a full reboot of the group (a bootstrap by a server withgroup_replication_bootstrap_group=ON) is required in order for the value change to take effect. For instructions to migrate from one communication stack to another, see Section 20.6.1, “Communication Stack for Connection Security Management”.group_replication_components_stop_timeout命令行格式Command-Line Format --group-replication-components-stop-timeout=#系统变量System Variable group_replication_components_stop_timeout范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 300最小值Minimum Value 2最大值Maximum Value 31536000单位Unit 秒seconds 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_components_stop_timeout指定 Group Replication 在关闭时等待每个模块完成正在进行的进程的时间,单位为秒。组件超时在执行STOP GROUP_REPLICATION语句后生效,该语句会在服务器重启或自动重新加入期间自动执行。group_replication_components_stop_timeoutspecifies the time, in seconds, for which Group Replication waits for each of its modules to complete ongoing processes while shutting down. The component timeout applies after aSTOP GROUP_REPLICATIONstatement is issued, which happens automatically during server restart or auto-rejoin.超时用于解决 Group Replication 组件无法正常停止的情况,这可能发生在成员处于错误状态时被逐出群组,或者当某个进程(例如 MySQL Enterprise Backup)在成员上持有全局锁时。在这种情况下,成员无法停止应用线程或完成分布式恢复过程以重新加入。
STOP GROUP_REPLICATION命令不会完成,直到情况得到解决(例如通过释放锁),或者组件超时到期并且无论其状态如何都关闭模块。The timeout is used to resolve situations in which Group Replication components cannot be stopped normally, which might happen if a member is expelled from the group while it is in an error state, or while a process such as MySQL Enterprise Backup is holding a global lock on tables on the member. In such situations, the member cannot stop the applier thread or complete the distributed recovery process to rejoin.STOP GROUP_REPLICATIONdoes not complete until either the situation is resolved (for example, by the lock being released), or the component timeout expires and the modules are shut down regardless of their status.默认值为 300 秒,因此如果情况在此之前未得到解决,Group Replication 组件将在 5 分钟后停止,从而允许成员重启并重新加入。The default value is 300 seconds, so that Group Replication components are stopped after 5 minutes if the situation is not resolved before that time, allowing the member to be restarted and to rejoin.
group_replication_compression_threshold命令行格式Command-Line Format --group-replication-compression-threshold=#系统变量System Variable group_replication_compression_threshold范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 1000000最小值Minimum Value 0最大值Maximum Value 4294967295单位Unit 字节bytes 该阈值以字节为单位,当消息在组成员之间发送时,如果消息大小超过该值,则会应用压缩。如果此系统变量设置为零,则禁用压缩。
group_replication_compression_threshold的值应在所有组成员上保持一致。The threshold value in bytes above which compression is applied to messages sent between group members. If this system variable is set to zero, compression is disabled. The value ofgroup_replication_compression_thresholdshould be the same on all group members.组复制使用 LZ4 压缩算法来压缩在组中发送的消息。请注意,LZ4 压缩算法支持的最大输入大小为 2113929216 字节。该限制低于
group_replication_compression_threshold系统变量的最大可能值,该值与 XCom 接受的最大消息大小相匹配。使用 LZ4 压缩算法时,不要为group_replication_compression_threshold设置超过 2113929216 字节的值,因为当启用消息压缩时,超过此大小的事务无法提交。Group Replication uses the LZ4 compression algorithm to compress messages sent in the group. Note that the maximum supported input size for the LZ4 compression algorithm is 2113929216 bytes. This limit is lower than the maximum possible value for thegroup_replication_compression_thresholdsystem variable, which is matched to the maximum message size accepted by XCom. With the LZ4 compression algorithm, do not set a value greater than 2113929216 bytes forgroup_replication_compression_threshold, because transactions above this size cannot be committed when message compression is enabled.欲了解更多信息,请参见 第 20.7.4 节,“消息压缩”。For more information, see Section 20.7.4, “Message Compression”.
命令行格式Command-Line Format --group-replication-consistency=value系统变量System Variable group_replication_consistency范围Scope 全局,会话Global, Session 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 枚举Enumeration 默认值Default Value BEFORE_ON_PRIMARY_FAILOVERBEFORE_ON_PRIMARY_FAILOVER有效值Valid Values EVENTUALEVENTUALBEFORE_ON_PRIMARY_FAILOVERBEFORE_ON_PRIMARY_FAILOVERBEFOREAFTER之后AFTERBEFORE_AND_AFTERgroup_replication_consistency是一个服务器系统变量,而不是 Group Replication 插件特定的变量,因此无需重启 Group Replication 即可使更改生效。更改系统变量的会话值会立即生效,更改全局值会在更改后启动的新会话中生效。更改此系统变量的全局设置需要GROUP_REPLICATION_ADMIN权限。group_replication_consistencyis a server system variable rather than a Group Replication plugin-specific variable, so a restart of Group Replication is not required for the change to take effect. Changing the session value of the system variable takes effect immediately, and changing the global value takes effect for new sessions that start after the change. TheGROUP_REPLICATION_ADMINprivilege is required to change the global setting for this system variable.group_replication_consistency决定了一个群组提供的事务一致性保证;这可以全局设置,也可以针对每个事务设置。group_replication_consistency还决定了单主群组中新选主节点使用的隔离机制。必须同时考虑该变量对只读事务和读/写事务的影响。以下列表显示了该变量的可能取值,按事务一致性保证递增顺序排列:group_replication_consistencydetermines the transaction consistency guarantee which a group provides; this can done globally, or per transaction.group_replication_consistencyalso determines the fencing mechanism used by newly elected primaries in single primary groups. The effect of the variable must be considered both for read-only and for read/write transactions. The following list shows the possible values of this variable, in order of increasing transaction consistency guarantee:EVENTUALEVENTUAL只读事务和读写事务都不会在执行前等待前面的事务被应用。(在添加这些变量之前,这是默认行为。)读写事务不会等待其他成员应用事务。这意味着事务可以在一个成员上先被外部化,而在其他成员上尚未应用。这也意味着,在主节点故障切换的情况下,新主节点可以在之前主节点的事务尚未全部应用前接受新的只读事务,但不允许读写事务。Neither read-only nor read/write transactions wait for preceding transactions to be applied before executing. (Before this variables was added, this was the default behavior.) A read/write transaction does not wait for other members to apply a transaction. This means that a transaction can be externalized on one member before the others. This also means that, in the event of a primary failover, the new primary can accept new read-only transactions before the previous primary transactions have all been applied, though read/write transactions are not allowed.
BEFORE_ON_PRIMARY_FAILOVERBEFORE_ON_PRIMARY_FAILOVER对于新当选的主节点正在应用旧主节点的积压数据时,新建的只读或读写事务在任何积压数据应用完成之前都不会被应用。这确保了在主节点故障转移的情况下,客户端总是能看到主节点上的最新值,无论故障转移是否是有意的。这保证了一致性,但意味着如果正在应用积压数据,客户端必须能够处理延迟。这种延迟的长度取决于正在处理的积压数据的大小,但通常不会很长。New read-only or read/write transactions with a newly elected primary that is applying a backlog from the old primary are not applied until any backlog has been applied. This ensures that, in the event of primary failover, clients always see the latest value on the primary, regardless of whether the failover is intentional. This guarantees consistency, but means that clients must be able to handle the delay in the event that a backlog is being applied. The length of this delay depends on the size of the backlog being processed, but is usually not great.
BEFORE一个读/写事务在应用之前会等待所有之前的事务完成。一个只读事务在执行之前会等待所有之前的事务完成。这确保了该事务通过仅影响事务的延迟来读取最新值。通过确保仅在只读事务上使用,它减少了任何来自同步的开销。此一致性级别还包括由
BEFORE_ON_PRIMARY_FAILOVER提供的一致性保证。A read/write transaction waits for all preceding transactions to complete before being applied. A read-only transaction waits for all preceding transactions to complete before being executed. This ensures that this transaction reads the latest value by affecting only the latency of the transaction. This reduces any overhead from synchronization, by ensuring it is used on read-only transactions only. This consistency level also includes the consistency guarantees provided byBEFORE_ON_PRIMARY_FAILOVER.AFTER之后AFTER读/写事务会等待其更改被应用到所有其他成员。这一数值对只读事务没有影响,并确保当事务在本地成员提交时,任何后续事务都会在任意组成员上读取到该事务写入的值或更近的值。这意味着其他成员上的只读事务会保持未提交状态,直到所有前置事务提交,从而增加了受影响事务的延迟。A read/write transaction waits until its changes have been applied to all of the other members. This value has no effect on read-only transactions, and ensures that, when a transaction is committed on the local member, any subsequent transaction reads the value written or a more recent value on any group member. This means that read-only transactions on the other members remain uncommitted until all preceding transactions are committed, increasing the latency of the affected transaction.
在主要用于只读操作的组中使用此模式,以确保任何读/写事务一旦提交就会在所有地方应用。应用程序可以使用此模式来确保后续读取获取到最新数据,包括最新的写入。通过确保同步仅用于读/写事务,这可以减少同步带来的开销。Use this mode with a group that is intended primarily for read-only operations to ensure that any read/write transactions are applied everywhere once they commit. This can be used by your application to ensure that subsequent reads fetch the latest data, including the latest writes. This reduces any overhead from synchronization, by ensuring that synchronization is used for read/write transactions only.
AFTER包括BEFORE_ON_PRIMARY_FAILOVER提供的一致性保证。AFTERincludes the consistency guarantees provided byBEFORE_ON_PRIMARY_FAILOVER.BEFORE_AND_AFTER读/写事务会等待所有先前事务完成,并且等待其所有更改在其他成员上应用之后才会被应用。只读事务会在执行前等待所有先前事务完成。该一致性级别也包括
BEFORE_ON_PRIMARY_FAILOVER提供的一致性保证。A read/write transaction waits for all preceding transactions to complete, and for all its changes to be applied on all other members, before being applied. A read-only transaction waits for all preceding transactions to complete before execution takes place. This consistency level also includes the consistency guarantees provided byBEFORE_ON_PRIMARY_FAILOVER.
欲了解更多信息,请参阅 第 20.5.3 节,“事务一致性保证”。For more information, see Section 20.5.3, “Transaction Consistency Guarantees”.
group_replication_enforce_update_everywhere_checks命令行格式Command-Line Format --group-replication-enforce-update-everywhere-checks[={OFF|ON}]系统变量System Variable group_replication_enforce_update_everywhere_checks范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFFNote此系统变量是组范围的配置设置,更改生效需要对复制组进行完全重启。This system variable is a group-wide configuration setting, and a full reboot of the replication group is required for a change to take effect.
group_replication_enforce_update_everywhere_checks启用或禁用针对多主“全域更新”的严格一致性检查。默认情况下,检查是禁用的。在单主模式下,此选项必须在所有组成员上禁用。在多主模式下,当启用此选项时,将按如下方式检查语句,以确保它们与多主模式兼容:group_replication_enforce_update_everywhere_checksenables or disables strict consistency checks for multi-primary update everywhere. The default is that checks are disabled. In single-primary mode, this option must be disabled on all group members. In multi-primary mode, when this option is enabled, statements are checked as follows to ensure they are compatible with multi-primary mode:如果事务在
SERIALIZABLE隔离级别下执行,则在与组同步时其提交会失败。If a transaction is executed under theSERIALIZABLEisolation level, then its commit fails when synchronizing itself with the group.如果事务针对具有级联约束的外键的表执行,则在与组同步时该事务提交会失败。If a transaction executes against a table that has foreign keys with cascading constraints, then the transaction fails to commit when synchronizing itself with the group.
此系统变量是一个组范围的配置设置。它在所有组成员上必须具有相同的值,组复制运行时无法更改,并且需要对整个组进行完全重启(由启用了
group_replication_bootstrap_group=ON的服务器引导)才能使值更改生效。有关如何在事务已执行并认证的情况下安全引导组的说明,请参阅 第 20.5.2 节,“重启一个组”。This system variable is a group-wide configuration setting. It must have the same value on all group members, cannot be changed while Group Replication is running, and requires a full reboot of the group (a bootstrap by a server withgroup_replication_bootstrap_group=ON) in order for the value change to take effect. For instructions to safely bootstrap a group where transactions have been executed and certified, see Section 20.5.2, “Restarting a Group”.如果该组为此系统变量设置了值,而加入的成员为该系统变量设置了不同的值,则加入的成员在将值更改为匹配之前无法加入该组。如果组成员为此系统变量设置了值,而加入的成员不支持该系统变量,则它无法加入该组。If the group has a value set for this system variable, and a joining member has a different value set for the system variable, the joining member cannot join the group until the value is changed to match. If the group members have a value set for this system variable, and the joining member does not support the system variable, it cannot join the group.
使用
group_replication_switch_to_single_primary_mode()和group_replication_switch_to_multi_primary_mode()函数在组仍在运行时更改此系统变量的值。有关详细信息,请参阅 第 20.5.1.2 节,“更改组模式”。Use thegroup_replication_switch_to_single_primary_mode()andgroup_replication_switch_to_multi_primary_mode()functions to change the value of this system variable while the group is still running. For more information, see Section 20.5.1.2, “Changing the Group Mode”.group_replication_exit_state_action命令行格式Command-Line Format --group-replication-exit-state-action=value--group-replication-exit-state-action=value系统变量System Variable group_replication_exit_state_action范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 枚举Enumeration 默认值Default Value OFFLINE_MODEOFFLINE_MODE有效值Valid Values ABORT_SERVERABORT_SERVEROFFLINE_MODEOFFLINE_MODEREAD_ONLYREAD_ONLY在组复制运行期间,可以更改此系统变量的值,并且更改会立即生效。当发生需要该行为的问题时,会读取该系统变量的当前值。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately. The system variable's current value is read when an issue occurs that means the behavior is needed.
group_replication_exit_state_action配置当该服务器实例意外离开组时 Group Replication 的行为,例如在遇到应用程序错误后,或者在失去多数成员的情况下,或者当组中的其他成员因为怀疑超时而将其驱逐时。成员在失去多数的情况下离开组的超时时间由group_replication_unreachable_majority_timeout系统变量设置,怀疑超时的时间由group_replication_member_expel_timeout系统变量设置。请注意,被驱逐的组成员在重新连接到组之前不会知道自己已被驱逐,因此指定的操作只有在成员成功重新连接,或者成员对自己产生怀疑并自我驱逐时才会执行。group_replication_exit_state_actionconfigures how Group Replication behaves when this server instance leaves the group unintentionally, for example after encountering an applier error, or in the case of a loss of majority, or when another member of the group expels it due to a suspicion timing out. The timeout period for a member to leave the group in the case of a loss of majority is set by thegroup_replication_unreachable_majority_timeoutsystem variable, and the timeout period for suspicions is set by thegroup_replication_member_expel_timeoutsystem variable. Note that an expelled group member does not know that it was expelled until it reconnects to the group, so the specified action is only taken if the member manages to reconnect, or if the member raises a suspicion on itself and expels itself.当由于怀疑超时或失去多数而导致某个组成员被开除时,如果该成员已将
group_replication_autorejoin_tries系统变量设置为指定的自动重新加入尝试次数,它会首先在超级只读模式下进行指定次数的尝试,然后执行group_replication_exit_state_action指定的操作。出现应用器错误时不会进行自动重新加入尝试,因为这些错误是不可恢复的。When a group member is expelled due to a suspicion timing out or a loss of majority, if the member has thegroup_replication_autorejoin_triessystem variable set to specify a number of auto-rejoin attempts, it first makes the specified number of attempts while in super read only mode, and then follows the action specified bygroup_replication_exit_state_action. Auto-rejoin attempts are not made in case of an applier error, because these are not recoverable.当
group_replication_exit_state_action设置为READ_ONLY时,如果成员非预期地退出组或耗尽其自动重新加入的尝试,该实例会将 MySQL 切换为超级只读模式(通过将系统变量super_read_only设置为ON)。Whengroup_replication_exit_state_actionis set toREAD_ONLY, if the member exits the group unintentionally or exhausts its auto-rejoin attempts, the instance switches MySQL to super read only mode (by setting the system variablesuper_read_onlytoON).当
group_replication_exit_state_action设置为OFFLINE_MODE时,如果成员非意图地退出组或耗尽其自动重加入尝试,实例会将 MySQL 切换到离线模式(通过将系统变量offline_mode设置为ON)。在此模式下,已连接的客户端用户在下一次请求时会被断开连接,并且不再接受新连接,唯一例外的是拥有CONNECTION_ADMIN权限(或已弃用的SUPER权限)的客户端用户。群复制还会将系统变量super_read_only设置为ON,因此即使客户端拥有CONNECTION_ADMIN或SUPER权限,也无法进行任何更新操作。Whengroup_replication_exit_state_actionis set toOFFLINE_MODE, if the member exits the group unintentionally or exhausts its auto-rejoin attempts, the instance switches MySQL to offline mode (by setting the system variableoffline_modetoON). In this mode, connected client users are disconnected on their next request and connections are no longer accepted, with the exception of client users that have theCONNECTION_ADMINprivilege (or the deprecatedSUPERprivilege). Group Replication also sets the system variablesuper_read_onlytoON, so clients cannot make any updates, even if they have connected with theCONNECTION_ADMINorSUPERprivilege.当
group_replication_exit_state_action设置为ABORT_SERVER时,如果成员非自愿退出组或用尽了自动重新加入尝试,实例将关闭 MySQL。Whengroup_replication_exit_state_actionis set toABORT_SERVER, if the member exits the group unintentionally or exhausts its auto-rejoin attempts, the instance shuts down MySQL.Important如果在成员成功加入群组之前发生故障,则指定的退出操作不会执行。如果在本地配置检查期间发生故障,或者加入成员的配置与群组的配置不匹配,就会出现这种情况。在这些情况下,
super_read_only系统变量保持其原始值,连接继续被接受,服务器不会关闭 MySQL。因此,为了确保在群组复制未启动时服务器不能接受更新,我们建议在服务器启动时在配置文件中设置super_read_only=ON,群组复制在主成员成功启动后将其更改为OFF。当服务器配置为在启动时启动群组复制(group_replication_start_on_boot=ON)时,这一保障尤其重要,但当使用START GROUP_REPLICATION语句手动启动群组复制时,这同样是有用的。If a failure occurs before the member has successfully joined the group, the specified exit action is not taken. This is the case if there is a failure during the local configuration check, or a mismatch between the configuration of the joining member and the configuration of the group. In these situations, thesuper_read_onlysystem variable is left with its original value, connections continue to be accepted, and the server does not shut down MySQL. To ensure that the server cannot accept updates when Group Replication did not start, we therefore recommend thatsuper_read_only=ONis set in the server's configuration file at startup, which Group Replication changes toOFFon primary members after it has been started successfully. This safeguard is particularly important when the server is configured to start Group Replication on server boot (group_replication_start_on_boot=ON), but it is also useful when Group Replication is started manually using aSTART GROUP_REPLICATIONstatement.有关使用此选项的更多信息,以及执行退出操作的完整情况列表,请参阅 第 20.7.7.4 节,“退出操作”。For more information on using this option, and the full list of situations in which the exit action is taken, see Section 20.7.7.4, “Exit Action”.
group_replication_flow_control_applier_threshold命令行格式Command-Line Format --group-replication-flow-control-applier-threshold=#系统变量System Variable group_replication_flow_control_applier_threshold范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 25000最小值Minimum Value 0最大值Maximum Value 2147483647单位Unit 事务transactions 在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_applier_threshold指定应用器队列中等待的事务数量,该数量触发流量控制。group_replication_flow_control_applier_thresholdspecifies the number of waiting transactions in the applier queue that trigger flow control.group_replication_flow_control_certifier_threshold命令行格式Command-Line Format --group-replication-flow-control-certifier-threshold=#系统变量System Variable group_replication_flow_control_certifier_threshold范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 25000最小值Minimum Value 0最大值Maximum Value 2147483647单位Unit 事务transactions 在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_certifier_threshold指定触发流控的认证队列中等待事务的数量。group_replication_flow_control_certifier_thresholdspecifies the number of waiting transactions in the certifier queue that trigger flow control.group_replication_flow_control_hold_percent命令行格式Command-Line Format --group-replication-flow-control-hold-percent=#系统变量System Variable group_replication_flow_control_hold_percent范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 10最小值Minimum Value 0最大值Maximum Value 100单位Unit 百分比percentage 在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_hold_percent定义了为了让处于流量控制下的集群赶上积压任务,组配额中未使用的百分比。值为 0 表示配额中没有部分是保留用于赶上工作积压的。group_replication_flow_control_hold_percentdefines what percentage of the group quota remains unused to allow a cluster under flow control to catch up on backlog. A value of 0 implies that no part of the quota is reserved for catching up on the work backlog.group_replication_flow_control_max_quota命令行格式Command-Line Format --group-replication-flow-control-max-quota=#系统变量System Variable group_replication_flow_control_max_quota范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值Maximum Value 2147483647在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_max_quota定义了组的最大流控配额,或者在启用流控时任何周期的最大可用配额。值为 0 表示没有设置最大配额。此系统变量的值不能小于group_replication_flow_control_min_quota和group_replication_flow_control_min_recovery_quota。group_replication_flow_control_max_quotadefines the maximum flow control quota of the group, or the maximum available quota for any period while flow control is enabled. A value of 0 implies that there is no maximum quota set. The value of this system variable cannot be smaller thangroup_replication_flow_control_min_quotaandgroup_replication_flow_control_min_recovery_quota.group_replication_flow_control_member_quota_percent命令行格式Command-Line Format --group-replication-flow-control-member-quota-percent=#系统变量System Variable group_replication_flow_control_member_quota_percent范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值Maximum Value 100单位Unit 百分比percentage 在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_member_quota_percent定义了成员在计算配额时应认为自己可用的配额百分比。值为 0 表示配额应在上一个周期中担任写入者的成员之间平均分配。group_replication_flow_control_member_quota_percentdefines the percentage of the quota that a member should assume is available for itself when calculating the quotas. A value of 0 implies that the quota should be split equally between members that were writers in the last period.group_replication_flow_control_min_quota命令行格式Command-Line Format --group-replication-flow-control-min-quota=#系统变量System Variable group_replication_flow_control_min_quota范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值Maximum Value 2147483647在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_min_quota控制可以分配给成员的最低流量控制配额,这与上一个周期执行的计算最小配额无关。值为 0 表示没有最低配额。该系统变量的值不能大于group_replication_flow_control_max_quota。group_replication_flow_control_min_quotacontrols the lowest flow control quota that can be assigned to a member, independently of the calculated minimum quota executed in the last period. A value of 0 implies that there is no minimum quota. The value of this system variable cannot be larger thangroup_replication_flow_control_max_quota.group_replication_flow_control_min_recovery_quota命令行格式Command-Line Format --group-replication-flow-control-min-recovery-quota=#系统变量System Variable group_replication_flow_control_min_recovery_quota范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值Maximum Value 2147483647在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_min_recovery_quota控制由于组中其他成员正在恢复而可以分配给某个成员的最低配额,这与上一周期执行的计算最小配额无关。值为 0 表示没有最低配额。此系统变量的值不能大于group_replication_flow_control_max_quota。group_replication_flow_control_min_recovery_quotacontrols the lowest quota that can be assigned to a member because of another recovering member in the group, independently of the calculated minimum quota executed in the last period. A value of 0 implies that there is no minimum quota. The value of this system variable cannot be larger thangroup_replication_flow_control_max_quota.group_replication_flow_control_mode命令行格式Command-Line Format --group-replication-flow-control-mode=value系统变量System Variable group_replication_flow_control_mode范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 枚举Enumeration 默认值Default Value QUOTA有效值Valid Values DISABLEDDISABLEDQUOTA在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_mode指定用于流量控制的模式。group_replication_flow_control_modespecifies the mode used for flow control.group_replication_flow_control_period命令行格式Command-Line Format --group-replication-flow-control-period=#系统变量System Variable group_replication_flow_control_period范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 1最小值Minimum Value 1最大值Maximum Value 60单位Unit 秒seconds 在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_period定义在流控迭代之间等待的秒数,在这些迭代中发送流控消息并运行流控管理任务。group_replication_flow_control_perioddefines how many seconds to wait between flow control iterations, in which flow control messages are sent and flow control management tasks are run.group_replication_flow_control_release_percent命令行格式Command-Line Format --group-replication-flow-control-release-percent=#系统变量System Variable group_replication_flow_control_release_percent范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 50最小值Minimum Value 0最大值Maximum Value 1000单位Unit 百分比percentage 在组复制运行时可以更改此系统变量的值,并且更改会立即生效。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately.
group_replication_flow_control_release_percent定义了当流控制不再需要限制写入成员时,组配额应如何释放,该百分比表示每个流控制周期内的配额增加量。值为 0 表示一旦流控制阈值在限制范围内,配额将在一次流控制迭代中释放。该范围允许配额最多释放到当前配额的 10 倍,因为这可以提供更大的适应性,主要是在流控制周期较长且配额非常小时。group_replication_flow_control_release_percentdefines how the group quota should be released when flow control no longer needs to throttle the writer members, with this percentage being the quota increase per flow control period. A value of 0 implies that once the flow control thresholds are within limits the quota is released in a single flow control iteration. The range allows the quota to be released at up to 10 times current quota, as that allows a greater degree of adaptation, mainly when the flow control period is large and the quotas are very small.group_replication_force_members命令行格式Command-Line Format --group-replication-force-members=value系统变量System Variable group_replication_force_members范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 该系统变量用于强制新的组成员身份。该系统变量的值可以在组复制运行时更改,并且更改会立即生效。您只需在要保持在组中的一个组成员上设置该系统变量的值即可。有关可能需要强制新的组成员身份的情况及使用此系统变量时应遵循的程序的详细信息,请参阅 第 20.7.8 节,“处理网络分区和法定人数丢失”。This system variable is used to force a new group membership. The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately. You only need to set the value of the system variable on one of the group members that is to remain in the group. For details of the situation in which you might need to force a new group membership, and a procedure to follow when using this system variable, see Section 20.7.8, “Handling a Network Partition and Loss of Quorum”.
group_replication_force_members指定一个以逗号分隔的对等地址列表,例如host1:port1,host2:port2。任何未包含在列表中的现有成员将不会接收组的新视图,并且会被阻止。对于每个要继续作为成员的现有成员,您必须包含 IP 地址或主机名以及端口,它们在每个成员的group_replication_local_address系统变量中给出。IPv6 地址必须用方括号括起来。例如:group_replication_force_membersspecifies a list of peer addresses as a comma separated list, such ashost1:port1,host2:port2. Any existing members that are not included in the list do not receive a new view of the group and are blocked. For each existing member that is to continue as a member, you must include the IP address or host name and the port, as they are given in thegroup_replication_local_addresssystem variable for each member. An IPv6 address must be specified in square brackets. For example:"198.51.100.44:33061,[2001:db8:85a3:8d3:1319:8a2e:370:7348]:33061,example.org:33061"
Group Replication 的组通信引擎 (XCom) 会检查所提供的 IP 地址是否为有效格式,并检查您是否包含了任何当前无法访问的组成员。否则,新配置将无法验证,因此您必须小心只包含在线且可以访问的组成员。列表中任何不正确的值或无效的主机名都可能导致组因配置无效而被阻塞。The group communication engine for Group Replication (XCom) checks that the supplied IP addresses are in a valid format, and checks that you have not included any group members that are currently unreachable. Otherwise, the new configuration is not validated, so you must be careful to include only online servers that are reachable members of the group. Any incorrect values or invalid host names in the list could cause the group to be blocked with an invalid configuration.
在强制新的成员配置之前,确保要排除的服务器已经关闭是非常重要的。如果没有,请在继续操作前将它们关闭。仍然在线的组成员可以自动形成新的配置,如果这种情况已经发生,再强制一个新的配置可能会为组创建一个人为的分裂脑 (split-brain) 情况。It is important before forcing a new membership configuration to ensure that the servers to be excluded have been shut down. If they are not, shut them down before proceeding. Group members that are still online can automatically form new configurations, and if this has already taken place, forcing a further new configuration could create an artificial split-brain situation for the group.
在您使用
group_replication_force_members系统变量成功强制新的群组成员并解除群组阻塞后,请确保清除该系统变量。group_replication_force_members必须为空,才能执行START GROUP_REPLICATION语句。After you have used thegroup_replication_force_memberssystem variable to successfully force a new group membership and unblock the group, ensure that you clear the system variable.group_replication_force_membersmust be empty in order to issue aSTART GROUP_REPLICATIONstatement.命令行格式Command-Line Format --group-replication-group-name=value系统变量System Variable group_replication_group_name范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 在组复制运行时,该系统变量的值无法更改。The value of this system variable cannot be changed while Group Replication is running.
group_replication_group_name指定该服务器实例所属的组名称,该名称必须是有效的 UUID。该 UUID 构成 GTID 的一部分,当组成员从客户端接收到事务以及组成员内部生成的视图更改事件写入二进制日志时将使用该 UUID。group_replication_group_namespecifies the name of the group which this server instance belongs to, which must be a valid UUID. This UUID forms part of the GTIDs that are used when transactions received by group members from clients, and view change events that are generated internally by the group members, are written to the binary log.Important必须使用唯一的 UUID。A unique UUID must be used.
命令行格式Command-Line Format --group-replication-group-seeds=value系统变量System Variable group_replication_group_seeds范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_group_seeds是一个组成员列表,新加入的成员可以连接这些成员以获取所有当前组成员的详细信息。新加入的成员使用这些详细信息选择并连接到一个组成员,以获取与组同步所需的数据。该列表由每个包含的种子成员的单个内部网络地址或主机名组成,这些地址或主机名是在种子成员的group_replication_local_address系统变量中配置的(而不是种子成员的 SQL 客户端连接,如 MySQL Server 的hostname和port系统变量所指定)。种子成员的地址以逗号分隔的列表指定,例如host1:port1,host2:port2。IPv6 地址必须用方括号括起来。例如:group_replication_group_seedsis a list of group members to which a joining member can connect to obtain details of all the current group members. The joining member uses these details to select and connect to a group member to obtain the data needed for synchrony with the group. The list consists of a single internal network address or host name for each included seed member, as configured in the seed member'sgroup_replication_local_addresssystem variable (not the seed member's SQL client connection, as specified by MySQL Server'shostnameandportsystem variables). The addresses of the seed members are specified as a comma separated list, such ashost1:port1,host2:port2. An IPv6 address must be specified in square brackets. For example:group_replication_group_seeds= "198.51.100.44:33061,[2001:db8:85a3:8d3:1319:8a2e:370:7348]:33061, example.org:33061"
请注意,您为此变量指定的值在发出
START GROUP_REPLICATION语句并且群组通信系统 (GCS) 可用之前不会进行验证。Note that the value you specify for this variable is not validated until aSTART GROUP_REPLICATIONstatement is issued and the Group Communication System (GCS) is available.通常此列表包含群组的所有成员,但您可以选择群组成员的子集作为种子。列表中必须至少包含一个有效的成员地址。每个地址在启动群组复制时会进行验证。如果列表中不包含任何有效的成员地址,发出
START GROUP_REPLICATION将失败。Usually this list consists of all members of the group, but you can choose a subset of the group members to be seeds. The list must contain at least one valid member address. Each address is validated when starting Group Replication. If the list does not contain any valid member addresses, issuingSTART GROUP_REPLICATIONfails.当一个服务器加入复制组时,它会尝试连接其
group_replication_group_seeds系统变量中列出的第一个种子成员。如果连接被拒绝,加入的成员会按顺序尝试连接列表中的其他种子成员。如果加入的成员连接到一个种子成员,但未因此被添加到复制组中(例如,因为该种子成员的允许列表中没有加入成员的地址而关闭了连接),加入的成员会继续按顺序尝试列表中剩余的种子成员。When a server is joining a replication group, it attempts to connect to the first seed member listed in itsgroup_replication_group_seedssystem variable. If the connection is refused, the joining member tries to connect to each of the other seed members in the list in order. If the joining member connects to a seed member but does not get added to the replication group as a result (for example, because the seed member does not have the joining member's address in its allowlist and closes the connection), the joining member continues to try the remaining seed members in the list in order.加入的成员必须使用与种子成员在
group_replication_group_seeds选项中公告的相同协议(IPv4 或 IPv6)与种子成员进行通信。为了满足组复制的 IP 地址权限要求,种子成员上的允许列表必须包括为加入成员提供的、与种子成员提供的协议对应的 IP 地址,或者能够解析为该协议地址的主机名。除了加入成员的group_replication_local_address外,如果该地址的协议与种子成员公告的协议不匹配,该地址或主机名也必须被设置并允许使用。如果加入成员没有适用于相应协议的允许地址,其连接尝试将被拒绝。更多信息,请参阅 第 20.6.4 节,“组复制 IP 地址权限”。A joining member must communicate with the seed member using the same protocol (IPv4 or IPv6) that the seed member advertises in thegroup_replication_group_seedsoption. For the purpose of IP address permissions for Group Replication, the allowlist on the seed member must include an IP address for the joining member for the protocol offered by the seed member, or a host name that resolves to an address for that protocol. This address or host name must be set up and permitted in addition to the joining member'sgroup_replication_local_addressif the protocol for that address does not match the seed member's advertised protocol. If a joining member does not have a permitted address for the appropriate protocol, its connection attempt is refused. For more information, see Section 20.6.4, “Group Replication IP Address Permissions”.group_replication_gtid_assignment_block_size命令行格式Command-Line Format --group-replication-gtid-assignment-block-size=#系统变量System Variable group_replication_gtid_assignment_block_size范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 1000000最小值Minimum Value 1最大值(64 位平台)Maximum Value (64-bit platforms) 9223372036854775807最大值(32 位平台)Maximum Value (32-bit platforms) 4294967295Note此系统变量是组范围的配置设置,更改生效需要对复制组进行完全重启。This system variable is a group-wide configuration setting, and a full reboot of the replication group is required for a change to take effect.
group_replication_gtid_assignment_block_size指定为每个组成员保留的连续 GTID 数量。每个成员使用自己的区块,并在需要时预留更多。group_replication_gtid_assignment_block_sizespecifies the number of consecutive GTIDs that are reserved for each group member. Each member consumes its own blocks and reserves more when needed.此系统变量是一个组范围的配置设置。它在所有组成员上必须具有相同的值,组复制运行时无法更改,并且需要对整个组进行完全重启(由启用了
group_replication_bootstrap_group=ON的服务器引导)才能使值更改生效。有关如何在事务已执行并认证的情况下安全引导组的说明,请参阅 第 20.5.2 节,“重启一个组”。This system variable is a group-wide configuration setting. It must have the same value on all group members, cannot be changed while Group Replication is running, and requires a full reboot of the group (a bootstrap by a server withgroup_replication_bootstrap_group=ON) in order for the value change to take effect. For instructions to safely bootstrap a group where transactions have been executed and certified, see Section 20.5.2, “Restarting a Group”.如果该组为此系统变量设置了值,而加入的成员为该系统变量设置了不同的值,则加入的成员在将值更改为匹配之前无法加入该组。如果组成员为此系统变量设置了值,而加入的成员不支持该系统变量,则它无法加入该组。If the group has a value set for this system variable, and a joining member has a different value set for the system variable, the joining member cannot join the group until the value is changed to match. If the group members have a value set for this system variable, and the joining member does not support the system variable, it cannot join the group.
group_replication_ip_allowlist命令行格式Command-Line Format --group-replication-ip-allowlist=value--group-replication-ip-allowlist=value系统变量System Variable group_replication_ip_allowlist范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 默认值Default Value AUTOMATICAUTOMATICgroup_replication_ip_allowlist指定允许连接到该组的主机。当组使用 XCom 通信栈时(group_replication_communication_stack=XCOM),允许列表用于控制对该组的访问。当组使用 MySQL 通信栈时(group_replication_communication_stack=MYSQL),使用用户认证来控制对该组的访问,而允许列表不使用,即使设置也会被忽略。group_replication_ip_allowlistspecifies which hosts are permitted to connect to the group. When the XCom communication stack is in use for the group (group_replication_communication_stack=XCOM), the allowlist is used to control access to the group. When the MySQL communication stack is in use for the group (group_replication_communication_stack=MYSQL), user authentication is used to control access to the group, and the allowlist is not used and is ignored if set.您为每个组成员在
group_replication_local_address指定的地址,必须在复制组中的其他服务器上允许。请注意,您为此变量指定的值在发出START GROUP_REPLICATION语句并且群组通信系统 (GCS) 可用之前不会进行验证。The address that you specify for each group member ingroup_replication_local_addressmust be permitted on the other servers in the replication group. Note that the value you specify for this variable is not validated until aSTART GROUP_REPLICATIONstatement is issued and the Group Communication System (GCS) is available.默认情况下,此系统变量设置为
AUTOMATIC,允许来自主机上活动的私有子网的连接。Group Replication 的组通信引擎(XCom)会自动扫描主机上的活动接口,并识别具有私有子网地址的接口。这些地址以及 IPv4 和 IPv6 的localhostIP 地址用于创建 Group Replication 允许列表。有关自动允许地址的范围列表,请参见 第 20.6.4 节,“Group Replication IP Address Permissions”。By default, this system variable is set toAUTOMATIC, which permits connections from private subnetworks active on the host. The group communication engine for Group Replication (XCom) automatically scans active interfaces on the host, and identifies those with addresses on private subnetworks. These addresses and thelocalhostIP address for IPv4 and IPv6 are used to create the Group Replication allowlist. For a list of the ranges from which addresses are automatically permitted, see Section 20.6.4, “Group Replication IP Address Permissions”.私人地址的自动允许列表不能用于来自私人网络外部服务器的连接。对于在不同机器上的服务器实例之间的组复制连接,您必须提供公共 IP 地址,并将其作为显式允许列表指定。如果您为允许列表指定了任何条目,则私人地址不会自动添加,因此如果您使用其中的任何一个,必须显式指定它们。
localhostIP 地址会自动添加。The automatic allowlist of private addresses cannot be used for connections from servers outside the private network. For Group Replication connections between server instances that are on different machines, you must provide public IP addresses and specify these as an explicit allowlist. If you specify any entries for the allowlist, the private addresses are not added automatically, so if you use any of these, you must specify them explicitly. ThelocalhostIP addresses are added automatically.作为
group_replication_ip_allowlist选项的值,您可以指定以下任意组合:As the value of thegroup_replication_ip_allowlistoption, you can specify any combination of the following:IPv4 地址(例如,
198.51.100.44)IPv4 addresses (for example,198.51.100.44)带 CIDR 表示法的 IPv4 地址(例如,
192.0.2.21/24)IPv4 addresses with CIDR notation (for example,192.0.2.21/24)IPv6 地址(例如,
2001:db8:85a3:8d3:1319:8a2e:370:7348)IPv6 addresses (for example,2001:db8:85a3:8d3:1319:8a2e:370:7348)使用 CIDR 表示法的 IPv6 地址(例如,
2001:db8:85a3:8d3::/64)IPv6 addresses using CIDR notation (for example,2001:db8:85a3:8d3::/64)主机名(例如,
example.org)Host names (for example,example.org)带 CIDR 表示法的主机名(例如,
www.example.com/24)Host names with CIDR notation (for example,www.example.com/24)
主机名可以解析为 IPv4 地址、IPv6 地址或两者兼有。如果主机名同时解析为 IPv4 和 IPv6 地址,则 Group Replication 连接始终使用 IPv4 地址。您可以将 CIDR 表示法与主机名或 IP 地址结合使用,以允许具有特定网络前缀的一组 IP 地址,但您应确保指定子网中的所有 IP 地址都在您的控制之下。Host names can resolve to IPv4 addresses, IPv6 addresses, or both. If a host name resolves to both an IPv4 and an IPv6 address, the IPv4 address is always used for Group Replication connections. You can use CIDR notation in combination with host names or IP addresses to permit a block of IP addresses with a particular network prefix, but you should ensure that all the IP addresses in the specified subnet are under your control.
允许列表中的每个条目必须用逗号分隔。例如:A comma must separate each entry in the allowlist. For example:
"192.0.2.21/24,198.51.100.44,203.0.113.0/24,2001:db8:85a3:8d3:1319:8a2e:370:7348,example.org,www.example.com/24"
如果组的任何种子成员在
group_replication_group_seeds选项中使用 IPv6 地址列出,而加入的成员使用 IPv4group_replication_local_address,或者反之,则必须为加入的成员设置并允许种子成员提供协议的备用地址(或解析到该协议地址的主机名)。更多信息,请参阅 第 20.6.4 节,“组复制 IP 地址权限”。If any of the seed members for the group are listed in thegroup_replication_group_seedsoption with an IPv6 address when a joining member has an IPv4group_replication_local_address, or the reverse, you must also set up and permit an alternative address for the joining member for the protocol offered by the seed member (or a host name that resolves to an address for that protocol). For more information, see Section 20.6.4, “Group Replication IP Address Permissions”.根据您的安全需求,可以为不同的组成员配置不同的允许列表,例如,为了保持不同子网的独立性。然而,当组重新配置时,这可能会引发问题。如果没有特定的安全需求,建议在组的所有成员上使用相同的允许列表。更多详情,请参见 第 20.6.4 节,“群组复制 IP 地址权限”。It is possible to configure different allowlists on different group members according to your security requirements, for example, in order to keep different subnets separate. However, this can cause issues when a group is reconfigured. If you do not have a specific security requirement to do otherwise, use the same allowlist on all members of a group. For more details, see Section 20.6.4, “Group Replication IP Address Permissions”.
对于主机名,只有在另一台服务器发出连接请求时才会进行名称解析。无法解析的主机名不会被考虑进行允许列表验证,并且会向错误日志写入警告信息。对于已解析的主机名,将进行正向确认的反向 DNS (FCrDNS) 验证。For host names, name resolution takes place only when a connection request is made by another server. A host name that cannot be resolved is not considered for allowlist validation, and a warning message is written to the error log. Forward-confirmed reverse DNS (FCrDNS) verification is carried out for resolved host names.
Warning主机名在允许列表中本质上比 IP 地址的安全性低。FCrDNS 验证提供了良好的保护水平,但可能会被某些类型的攻击破坏。仅在严格必要的情况下在允许列表中指定主机名,并确保用于名称解析的所有组件(例如 DNS 服务器)都由您控制。您还可以使用 hosts 文件在本地实现名称解析,以避免使用外部组件。Host names are inherently less secure than IP addresses in an allowlist. FCrDNS verification provides a good level of protection, but can be compromised by certain types of attack. Specify host names in your allowlist only when strictly necessary, and ensure that all components used for name resolution, such as DNS servers, are maintained under your control. You can also implement name resolution locally using the hosts file, to avoid the use of external components.
group_replication_local_address命令行格式Command-Line Format --group-replication-local-address=value系统变量System Variable group_replication_local_address范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_local_address设置成员提供给其他成员连接的网络地址,格式为host:port字符串。该地址必须对组内所有成员可达,因为它被组通信引擎用于 Group Replication(XCom,一种 Paxos 变体)在远程 XCom 实例之间进行 TCP 通信。如果您使用 MySQL 通信栈在成员之间建立组通信连接(group_replication_communication_stack= MYSQL),则该地址必须是 MySQL 服务器监听的 IP 地址和端口之一,这些由服务器的bind_address系统变量指定。group_replication_local_addresssets the network address which the member provides for connections from other members, specified as ahost:portformatted string. This address must be reachable by all members of the group because it is used by the group communication engine for Group Replication (XCom, a Paxos variant) for TCP communication between remote XCom instances. If you are using the MySQL communication stack to establish group communication connections between members (group_replication_communication_stack= MYSQL), the address must be one of the IP addresses and ports where MySQL Server is listening on, as specified by thebind_addresssystem variable for the server.Warning不要使用此地址查询或管理会员上的数据库。这不是 SQL 客户端连接的主机和端口。Do not use this address to query or administer the databases on the member. This is not the SQL client connection host and port.
在
group_replication_local_address中指定的地址或主机名被组复制用作复制组中成员的唯一标识符。只要主机名或 IP 地址不同,你可以为复制组的所有成员使用相同的端口;只要端口不同,你也可以为所有成员使用相同的主机名或 IP 地址。group_replication_local_address的推荐端口是 33061。请注意,直到执行START GROUP_REPLICATION语句并且组通信系统 (GCS) 可用后,才会验证你为此变量指定的值。The address or host name that you specify ingroup_replication_local_addressis used by Group Replication as the unique identifier for a group member within the replication group. You can use the same port for all members of a replication group as long as the host names or IP addresses are all different, and you can use the same host name or IP address for all members as long as the ports are all different. The recommended port forgroup_replication_local_addressis 33061. Note that the value you specify for this variable is not validated until theSTART GROUP_REPLICATIONstatement is issued and the Group Communication System (GCS) is available.由
group_replication_local_address配置的网络地址必须能够被所有组成员解析。例如,如果每个服务器实例位于具有固定网络地址的不同机器上,你可以使用机器的 IP 地址,例如 10.0.0.1。如果使用主机名,则必须使用完全限定的名称,并确保其可以通过 DNS、正确配置的/etc/hosts文件或其他名称解析过程解析。IPv6 地址必须用方括号括起来以区分端口号,例如:The network address configured bygroup_replication_local_addressmust be resolvable by all group members. For example, if each server instance is on a different machine with a fixed network address, you could use the IP address of the machine, such as 10.0.0.1. If you use a host name, you must use a fully qualified name, and ensure it is resolvable through DNS, correctly configured/etc/hostsfiles, or other name resolution processes. An IPv6 address must be specified in square brackets in order to distinguish the port number, for example:group_replication_local_address= "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:33061"
如果指定为服务器实例的组复制本地地址的主机名既解析为 IPv4 地址又解析为 IPv6 地址,则组复制连接始终使用 IPv4 地址。有关组复制对 IPv6 网络的支持以及对同时使用 IPv4 和 IPv6 成员的复制组的更多信息,请参见 第 20.5.5 节,“支持 IPv6 及混合 IPv6 和 IPv4 组”。If a host name specified as the Group Replication local address for a server instance resolves to both an IPv4 and an IPv6 address, the IPv4 address is always used for Group Replication connections. For more information on Group Replication support for IPv6 networks and on replication groups with a mix of members using IPv4 and members using IPv6, see Section 20.5.5, “Support For IPv6 And For Mixed IPv6 And IPv4 Groups”.
如果您使用 XCom 通信栈在成员之间建立组通信连接(
group_replication_communication_stack = XCOM),则必须将您在group_replication_local_address中为每个组成员指定的地址添加到复制组中其他服务器的group_replication_ip_allowlist系统变量列表中。当组中使用 XCom 通信栈时,允许列表用于控制对组的访问。当组中使用 MySQL 通信栈时,使用用户身份验证来控制对组的访问,而允许列表不会被使用,即使设置了也会被忽略。如果组的任何种子成员在group_replication_group_seeds中被列为 IPv6 地址,而该成员具有 IPv4 的group_replication_local_address,或者反之,您还必须为此成员设置并允许所需协议的备用地址(或解析为该协议地址的主机名)。有关更多信息,请参见 第 20.6.4 节,“组复制 IP 地址权限”。If you are using the XCom communication stack to establish group communication connections between members (group_replication_communication_stack = XCOM), the address that you specify for each group member ingroup_replication_local_addressmust be added to the list for thegroup_replication_ip_allowlistsystem variable on the other servers in the replication group. When the XCom communication stack is in use for the group, the allowlist is used to control access to the group. When the MySQL communication stack is in use for the group, user authentication is used to control access to the group, and the allowlist is not used and is ignored if set. If any of the seed members for the group are listed ingroup_replication_group_seedswith an IPv6 address when this member has an IPv4group_replication_local_address, or the reverse, you must also set up and permit an alternative address for this member for the required protocol (or a host name that resolves to an address for that protocol). For more information, see Section 20.6.4, “Group Replication IP Address Permissions”.group_replication_member_expel_timeout命令行格式Command-Line Format --group-replication-member-expel-timeout=#系统变量System Variable group_replication_member_expel_timeout范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 5最小值Minimum Value 0最大值Maximum Value 3600单位Unit 秒seconds 在组复制运行期间,可以更改此系统变量的值,更改会立即生效。每当组复制检查超时时,都会读取该系统变量的当前值。并非所有组成员必须具有相同的设置,但建议这样做以避免意外驱逐。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately. The current value of the system variable is read whenever Group Replication checks the timeout. It is not mandatory for all members of a group to have the same setting, but it is recommended in order to avoid unexpected expulsions.
group_replication_member_expel_timeout指定了 Group Replication 组成员在创建怀疑后等待的时间(以秒为单位),在将被怀疑失败的成员从组中驱逐之前。创建怀疑之前的初始 5 秒检测期不计入此时间。group_replication_member_expel_timeout的默认值为 5,这意味着在 5 秒检测期之后,怀疑成员可能在 5 秒后被驱逐。group_replication_member_expel_timeoutspecifies the period of time in seconds that a Group Replication group member waits after creating a suspicion, before expelling from the group the member suspected of having failed. The initial 5-second detection period before a suspicion is created does not count as part of this time. The value ofgroup_replication_member_expel_timeoutdefaults to 5, meaning that a suspected member is liable for expulsion 5 seconds after the 5-second detection period.在组成员上更改
group_replication_member_expel_timeout的值会立即对该组成员的现有和将来的怀疑生效。因此,您可以将此用作强制怀疑超时并驱逐被怀疑成员的方法,从而允许更改组配置。有关更多信息,请参阅 第 20.7.7.1 节,“驱逐超时”。Changing the value ofgroup_replication_member_expel_timeouton a group member takes effect immediately for existing as well as future suspicions on that group member. You can therefore use this as a method to force a suspicion to time out and expel a suspected member, allowing changes to the group configuration. For more information, see Section 20.7.7.1, “Expel Timeout”.增加
group_replication_member_expel_timeout的值可以帮助避免在较慢或不稳定的网络上,或在预期的短暂网络中断或机器减速情况下的不必要驱逐。如果被怀疑的成员在怀疑超时之前重新激活,它将应用由其他组成员缓冲的所有消息,并进入ONLINE状态,无需操作员干预。您可以指定最长为 3600 秒(1 小时)的超时时间。确保 XCom 的消息缓存足够大以容纳在您指定的时间段内预计的消息量,加上最初的 5 秒检测期,否则成员将无法重新连接。您可以使用group_replication_message_cache_size系统变量调整缓存大小限制。有关更多信息,请参见第 20.7.6 节,“XCom 缓存管理”。Increasing the value ofgroup_replication_member_expel_timeoutcan help to avoid unnecessary expulsions on slower or less stable networks, or in the case of expected transient network outages or machine slowdowns. If a suspect member becomes active again before the suspicion times out, it applies all the messages that were buffered by the remaining group members and entersONLINEstate, without operator intervention. You can specify a timeout value up to a maximum of 3600 seconds (1 hour). It is important to ensure that XCom's message cache is sufficiently large to contain the expected volume of messages in your specified time period, plus the initial 5-second detection period, otherwise members are unable to reconnect. You can adjust the cache size limit using thegroup_replication_message_cache_sizesystem variable. For more information, see Section 20.7.6, “XCom Cache Management”.如果超时被超过,嫌疑成员在怀疑超时后立即有被开除的责任。如果成员能够恢复通信并收到一个它被开除的视图,并且该成员已将
group_replication_autorejoin_tries系统变量设置为指定自动重新加入尝试的次数,它将按指定次数尝试在超级只读模式下重新加入群组。如果成员没有指定任何自动重新加入尝试,或者已用尽指定次数的尝试,它将遵循系统变量group_replication_exit_state_action指定的操作。If the timeout is exceeded, the suspect member is liable for expulsion immediately after the suspicion times out. If the member is able to resume communications and receives a view where it is expelled, and the member has thegroup_replication_autorejoin_triessystem variable set to specify a number of auto-rejoin attempts, it proceeds to make the specified number of attempts to rejoin the group while in super read only mode. If the member does not have any auto-rejoin attempts specified, or if it has exhausted the specified number of attempts, it follows the action specified by the system variablegroup_replication_exit_state_action.有关使用
group_replication_member_expel_timeout设置的更多信息,请参见 第 20.7.7.1 节,“驱逐超时”。对于在此系统变量不可用时避免不必要驱逐的替代缓解策略,请参见 第 20.3.2 节,“组复制限制”。For more information on using thegroup_replication_member_expel_timeoutsetting, see Section 20.7.7.1, “Expel Timeout”. For alternative mitigation strategies to avoid unnecessary expulsions where this system variable is not available, see Section 20.3.2, “Group Replication Limitations”.group_replication_member_weight命令行格式Command-Line Format --group-replication-member-weight=#系统变量System Variable group_replication_member_weight范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 50最小值Minimum Value 0最大值Maximum Value 100单位Unit 百分比percentage 在组复制运行时可以更改此系统变量的值,并且更改会立即生效。在发生故障转移时,会读取该系统变量的当前值。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately. The system variable's current value is read when a failover situation occurs.
group_replication_member_weight指定可以分配给成员的百分比权重,以在故障转移时影响成员被选为主节点的机会,例如当现有主节点离开单主组时。为成员分配数值权重,以确保特定成员被选举,例如在计划的主节点维护期间,或者在故障转移时确保某些硬件被优先考虑。group_replication_member_weightspecifies a percentage weight that can be assigned to members to influence the chance of the member being elected as primary in the event of failover, for example when the existing primary leaves a single-primary group. Assign numeric weights to members to ensure that specific members are elected, for example during scheduled maintenance of the primary or to ensure certain hardware is prioritized in the event of failover.对于配置如下成员的组:For a group with members configured as follows:
member-1: group_replication_member_weight=30, server_uuid=aaaamember-2: group_replication_member_weight=40, server_uuid=bbbbmember-3: group_replication_member_weight=40, server_uuid=ccccmember-4: group_replication_member_weight=40, server_uuid=dddd
在新主节点选举期间,上述成员将按
member-2,member-3,member-4,和member-1的顺序排序。这将导致在故障切换事件中member-2 被选为新的主节点。更多信息,请参见 20.1.3.1 节,“单主模式”。during election of a new primary the members above would be sorted asmember-2,member-3,member-4, andmember-1. This results inmember-2 being chosen as the new primary in the event of failover. For more information, see Section 20.1.3.1, “Single-Primary Mode”.group_replication_message_cache_size命令行格式Command-Line Format --group-replication-message-cache-size=#系统变量System Variable group_replication_message_cache_size范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 1073741824 (1 GB)最小值Minimum Value 134217728 (128 MB)最大值(64 位平台)Maximum Value (64-bit platforms) 18446744073709551615 (16 EiB)最大值(32 位平台)Maximum Value (32-bit platforms) 315360004294967295 (4 GB)单位Unit 字节bytes 这个系统变量在所有组成员中应具有相同的值。此系统变量的值可以在组复制运行时更改。更改在每个组成员上在停止并重新启动组复制后生效。在此过程中,系统变量的值允许在组成员之间有所不同,但在发生断开连接的情况下,成员可能无法重新连接。This system variable should have the same value on all group members. The value of this system variable can be changed while Group Replication is running. The change takes effect on each group member after you stop and restart Group Replication on the member. During this process, the value of the system variable is permitted to differ between group members, but members might be unable to reconnect in the event of a disconnection.
group_replication_message_cache_size设置 Group Replication (XCom) 组通信引擎中消息缓存可用的最大内存量。XCom 消息缓存保存组成员之间在一致性协议中交换的消息(及其元数据)。消息缓存的功能之一是用于重新加入组的成员在一段无法与其他组成员通信的时间后,恢复丢失的消息。group_replication_message_cache_sizesets the maximum amount of memory that is available for the message cache in the group communication engine for Group Replication (XCom). The XCom message cache holds messages (and their metadata) that are exchanged between the group members as a part of the consensus protocol. Among other functions, the message cache is used for recovery of missed messages by members that reconnect with the group after a period where they were unable to communicate with the other group members.group_replication_member_expel_timeout系统变量决定了除了最初的 5 秒检测期之外,允许成员返回群组而不被驱逐的等待时间(最长可达一小时)。XCom 消息缓存的大小应根据此时间段内预期的消息量进行设置,以确保包含成员成功返回所需的所有未接收消息。默认值是在 5 秒检测期之后等待 5 秒,总时间为 10 秒。Thegroup_replication_member_expel_timeoutsystem variable determines the waiting period (up to an hour) that is allowed in addition to the initial 5-second detection period for members to return to the group rather than being expelled. The size of the XCom message cache should be set with reference to the expected volume of messages in this time period, so that it contains all the missed messages required for members to return successfully. The default is a 5-second waiting period after the 5-second detection period, for a total time period of 10 seconds.确保您的系统中有足够的内存来满足您选择的缓存大小限制,同时要考虑服务器其他缓存和对象池的大小。默认设置为 1073741824 字节(1 GB)。最小设置为 134217728 字节(128 MB),使得可以在可用内存有限的主机上进行部署,并且在组成员的网络连接良好时,最小化临时连接丢失的频率和持续时间。请注意,使用
group_replication_message_cache_size设置的限制仅适用于缓存中存储的数据,而缓存结构则需要额外的 50 MB 内存。Ensure that sufficient memory is available on your system for your chosen cache size limit, considering the size of the server's other caches and object pools. The default setting is 1073741824 bytes (1 GB). The minimum setting of 134217728 bytes (128 MB) enables deployment on a host that has a restricted amount of available memory, and good network connectivity to minimize the frequency and duration of transient losses of connectivity for group members. Note that the limit set usinggroup_replication_message_cache_sizeapplies only to the data stored in the cache, and the cache structures require an additional 50 MB of memory.缓存大小限制可以在运行时动态增加或减少。如果您减少缓存大小限制,XCom 会删除已决定并已传递的最旧条目,直到当前大小低于限制。当消息缓存中可能需要用于恢复的、当前不可达的成员所需的消息被删除时,组复制的组通信系统(GCS)会通过警告消息提醒您。有关调整消息缓存大小的更多信息,请参阅 第 20.7.6 节,“XCom 缓存管理”。The cache size limit can be increased or reduced dynamically at runtime. If you reduce the cache size limit, XCom removes the oldest entries that have been decided and delivered until the current size is below the limit. Group Replication's Group Communication System (GCS) alerts you, by a warning message, when a message that is likely to be needed for recovery by a member that is currently unreachable is removed from the message cache. For more information on tuning the message cache size, see Section 20.7.6, “XCom Cache Management”.
group_replication_paxos_single_leader命令行格式Command-Line Format --group-replication-paxos-single-leader[={OFF|ON}]系统变量System Variable group_replication_paxos_single_leader范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFFNote此系统变量是组范围的配置设置,更改生效需要对复制组进行完全重启。This system variable is a group-wide configuration setting, and a full reboot of the replication group is required for a change to take effect.
group_replication_paxos_single_leader使群组通信引擎在单主模式下可以使用单一共识领导者运行。默认设置为OFF时,此行为被禁用,群组中的每个成员都充当领导者,这也是该系统变量引入之前版本的行为。当将此变量设置为ON时,群组通信引擎可以使用单一领导者来推动共识。在单主模式下使用单一共识领导者可以提高性能和弹性,特别是在群组的一些从属成员当前无法访问的情况下。有关更多信息,请参见 第 20.7.3 节,“单一共识领导者”。group_replication_paxos_single_leaderenables the group communication engine to operate with a single consensus leader when the group is in single-primary mode. With the default settingOFF, this behavior is disabled, and every member of the group is used as a leader, which is the behavior in releases before this system variable was available. When this variable is set toON, the group communication engine can use a single leader to drive consensus. Operating with a single consensus leader improves performance and resilience in single-primary mode, particularly when some of the group’s secondary members are currently unreachable. For more information, see Section 20.7.3, “Single Consensus Leader”.为了让组通信引擎使用单一共识领导者,组的通信协议版本必须是 MySQL 8.0.27 或更高版本。使用
group_replication_get_communication_protocol()获取组的通信协议版本。如果使用的是低版本,组将无法使用此行为。如果所有组成员都支持,可以使用group_replication_set_communication_protocol()将通信协议设置为更高版本。有关更多信息,请参见 第 20.5.1.4 节,“设置组的通信协议版本”。In order for the group communication engine to use a single consensus leader, the group's communication protocol version must be MySQL 8.0.27 or later. Usegroup_replication_get_communication_protocol()to obtain the group's communication protocol version. If a lower version is in use, the group cannot use this behavior. You can usegroup_replication_set_communication_protocol()to set the communication protocol to a higher version if all group members support it. For more information, see Section 20.5.1.4, “Setting a Group's Communication Protocol Version”.此系统变量是一个组范围的配置设置。它在所有组成员上必须具有相同的值,组复制运行时无法更改,并且需要对整个组进行完全重启(由启用了
group_replication_bootstrap_group=ON的服务器引导)才能使值更改生效。有关如何在事务已执行并认证的情况下安全引导组的说明,请参阅 第 20.5.2 节,“重启一个组”。This system variable is a group-wide configuration setting. It must have the same value on all group members, cannot be changed while Group Replication is running, and requires a full reboot of the group (a bootstrap by a server withgroup_replication_bootstrap_group=ON) in order for the value change to take effect. For instructions to safely bootstrap a group where transactions have been executed and certified, see Section 20.5.2, “Restarting a Group”.如果该组为此系统变量设置了值,而加入的成员为该系统变量设置了不同的值,则加入的成员在将值更改为匹配之前无法加入该组。如果组成员为此系统变量设置了值,而加入的成员不支持该系统变量,则它无法加入该组。If the group has a value set for this system variable, and a joining member has a different value set for the system variable, the joining member cannot join the group until the value is changed to match. If the group members have a value set for this system variable, and the joining member does not support the system variable, it cannot join the group.
性能模式表
replication_group_communication_information的WRITE_CONSENSUS_SINGLE_LEADER_CAPABLE列显示该组是否支持使用单个领导者,即使查询的成员上group_replication_paxos_single_leader当前设置为OFF。如果该组在启动时将group_replication_paxos_single_leader设置为ON,并且其通信协议版本为 MySQL 8.0.27 或更高版本,则该列值为 1。TheWRITE_CONSENSUS_SINGLE_LEADER_CAPABLEcolumn of the Performance Schema tablereplication_group_communication_informationshows whether the group supports the use of a single leader, even ifgroup_replication_paxos_single_leaderis currently set toOFFon the queried member. The column value is 1 if the group was started withgroup_replication_paxos_single_leaderset toON, and its communication protocol version is MySQL 8.0.27 or later.group_replication_poll_spin_loops命令行格式Command-Line Format --group-replication-poll-spin-loops=#系统变量System Variable group_replication_poll_spin_loops范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值(64 位平台)Maximum Value (64-bit platforms) 18446744073709551615最大值(32 位平台)Maximum Value (32-bit platforms) 4294967295此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_poll_spin_loops指定组通信线程在等待更多传入网络消息之前,等待通信引擎互斥锁释放的次数。group_replication_poll_spin_loopsspecifies the number of times the group communication thread waits for the communication engine mutex to be released before the thread waits for more incoming network messages.group_replication_preemptive_garbage_collection命令行格式Command-Line Format --group-replication-preemptive-garbage-collection[=ON|OFF]系统变量System Variable group_replication_preemptive_garbage_collection范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFF在单主模式(仅)中启用抢占式垃圾回收,仅保留那些尚未在数据库中提交的事务的写集。Enable preemptive garbage collection in single-primary mode (only), keeping only the write sets for those transactions that have not yet been committed in the database.
在单主模式下,可以比在多主模式下更早地清理给定事务的写集;这是因为冲突在事务执行期间由服务器中的数据库锁管理器检测和处理;因此,写集仅用于计算事务之间的依赖关系,而不用于冲突检测。这意味着,一旦事务在组复制事务依赖和冲突检测模块中被跟踪,它所属的写集就可以被清理。In single-primary mode it is possible to clean up write sets for a given transaction earlier than in multi-primary mode; this is because conflicts are detected and handled by the database lock manager in the server while transactions are executing; thus, the write sets are useful only for calculating dependencies between transactions, and not for conflict detection. This means that write sets can be cleaned up as soon as the transaction to which they belong is tracked in the Group Replication transaction dependency and conflict detection module.
当启用
group_replication_preemptive_garbage_collection时,对写集进行的积极清理具有以下效果:The aggressive purging of write sets which is performed whengroup_replication_preemptive_garbage_collectionis enabled has the following effects:减少用于在内存中保持写集的内存消耗Reduction in memory used to keep write sets in memory
减少滞后副本对主节点写集跟踪的影响Reduction of the impact of lagging secondaries on the tracking of write sets on the primary
减少每轮写集删除中写集数据库锁保持时间的数量,从而降低其对吞吐量的影响Reduction of the amount of time that the write set database lock is held per round of write set deletion, and thus a reduction of its impact on throughput
只有在 Group Replication 未运行时,才能更改
group_replication_preemptive_garbage_collection的值,并且对以多主模式运行的组没有影响。此外,当启用该系统变量时,无法在多主模式和单主模式之间切换(参见第 20.5.1.2 节,“更改组模式”)。The value ofgroup_replication_preemptive_garbage_collectioncan be changed only when Group Replication is not running, and has no effect on a group running in multi-primary mode. In addition, when this system variable is enabled, it is not possible to change between multi-primary mode and single-primary mode (see Section 20.5.1.2, “Changing the Group Mode”).group_replication_preemptive_garbage_collection必须在所有组成员上设置为相同的值。新加入成员的group_replication_preemptive_garbage_collection值必须与组中所有当前成员的值相同,否则它无法加入。group_replication_preemptive_garbage_collectionmust be set to the same value on all group members. A new joiner'sgroup_replication_preemptive_garbage_collectionvalue must be the same as those of all the group's current members, else it cannot join.运行 MySQL 8.4.0 之前版本的组成员不会发送
group_replication_preemptive_garbage_collection值;在这种情况下,该值被视为OFF。A group member running a version of MySQL previous to 8.4.0 sends nogroup_replication_preemptive_garbage_collectionvalue; in such cases, the value is considered to beOFF.group_replication_preemptive_garbage_collection_rows_threshold命令行格式Command-Line Format --group-replication-preemptive-garbage-collection-rows-threshold=#系统变量System Variable group_replication_preemptive_garbage_collection_rows_threshold范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 100000最小值Minimum Value 10000最大值Maximum Value 100000000当在单主模式下启用抢占式垃圾回收(
group_replication_preemptive_garbage_collection为ON)时,这是触发其使用所需的认证信息行数。When preemptive garbage collection in single-primary mode is enabled (group_replication_preemptive_garbage_collectionisON), this is the number of rows of certification information needed to trigger its use.此变量对运行在多主模式的组没有影响。This variable has no effect on a group running in multi-primary mode.
group_replication_recovery_compression_algorithms命令行格式Command-Line Format --group-replication-recovery-compression-algorithms=value系统变量System Variable group_replication_recovery_compression_algorithms范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 设置Set 默认值Default Value uncompresseduncompressed有效值Valid Values zlibzstduncompresseduncompressedgroup_replication_recovery_compression_algorithms指定允许用于组复制分布式恢复连接以从捐赠者的二进制日志进行状态传输的压缩算法。可用的算法与protocol_compression_algorithms系统变量相同。有关更多信息,请参见 第 6.2.8 节,“连接压缩控制”。group_replication_recovery_compression_algorithmsspecifies the compression algorithms permitted for Group Replication distributed recovery connections for state transfer from a donor's binary log. The available algorithms are the same as for theprotocol_compression_algorithmssystem variable. For more information, see Section 6.2.8, “Connection Compression Control”.此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
如果服务器已设置为支持克隆(参见第 20.5.4.2 节,“分布式恢复的克隆”)且在分布式恢复期间使用远程克隆操作,则此设置不适用。对于这种状态传输方法,克隆插件的
clone_enable_compression设置适用。This setting does not apply if the server has been set up to support cloning (see Section 20.5.4.2, “Cloning for Distributed Recovery”) and a remote cloning operation is used during distributed recovery. For this method of state transfer, the clone plugin'sclone_enable_compressionsetting applies.group_replication_recovery_get_public_key命令行格式Command-Line Format --group-replication-recovery-get-public-key[={OFF|ON}]系统变量System Variable group_replication_recovery_get_public_key范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFF此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_get_public_key指定是否从源端请求用于基于 RSA 密钥对密码交换的公钥。如果group_replication_recovery_public_key_path设置为有效的公钥文件,它将优先于group_replication_recovery_get_public_key。如果未在group_replication_recovery通道上使用 SSL 进行分布式恢复(group_replication_recovery_use_ssl=ON),并且 Group Replication 的复制用户账户使用caching_sha2_password插件(默认)进行认证,则此变量适用。更多详情,请参见 第 20.6.3.1.1 节“具有 Caching SHA-2 认证插件的复制用户”。group_replication_recovery_get_public_keyspecifies whether to request from the source the public key required for RSA key pair-based password exchange. Ifgroup_replication_recovery_public_key_pathis set to a valid public key file, it takes precedence overgroup_replication_recovery_get_public_key. This variable applies if you are not using SSL for distributed recovery over thegroup_replication_recoverychannel (group_replication_recovery_use_ssl=ON), and the replication user account for Group Replication authenticates with thecaching_sha2_passwordplugin (the default). For more details, see Section 20.6.3.1.1, “Replication User With The Caching SHA-2 Authentication Plugin”.group_replication_recovery_public_key_path命令行格式Command-Line Format --group-replication-recovery-public-key-path=file_name系统变量System Variable group_replication_recovery_public_key_path范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 文件名File name 默认值Default Value empty stringempty string此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_public_key_path指定包含源端用于基于 RSA 密钥对的密码交换所需公钥的副本的文件路径。该文件必须是 PEM 格式。如果group_replication_recovery_public_key_path设置为有效的公钥文件,它优先于group_replication_recovery_get_public_key。如果您在group_replication_recovery通道上不使用 SSL 进行分布式恢复(因此group_replication_recovery_use_ssl设置为OFF),并且 Group Replication 的复制用户帐户使用caching_sha2_password插件(默认)或sha256_password插件(已弃用)进行身份验证,则此变量适用。(对于sha256_password,仅当 MySQL 使用 OpenSSL 构建时,设置group_replication_recovery_public_key_path才适用。)更多详细信息,请参见 第 20.6.3.1.1 节,“使用 Caching SHA-2 认证插件的复制用户”。group_replication_recovery_public_key_pathspecifies the path name to a file containing a replica-side copy of the public key required by the source for RSA key pair-based password exchange. The file must be in PEM format. Ifgroup_replication_recovery_public_key_pathis set to a valid public key file, it takes precedence overgroup_replication_recovery_get_public_key. This variable applies if you are not using SSL for distributed recovery over thegroup_replication_recoverychannel (sogroup_replication_recovery_use_sslis set toOFF), and the replication user account for Group Replication authenticates with thecaching_sha2_passwordplugin (the default) or thesha256_passwordplugin (deprecated). (Forsha256_password, settinggroup_replication_recovery_public_key_pathapplies only if MySQL was built using OpenSSL.) For more details, see Section 20.6.3.1.1, “Replication User With The Caching SHA-2 Authentication Plugin”.group_replication_recovery_reconnect_interval命令行格式Command-Line Format --group-replication-recovery-reconnect-interval=#系统变量System Variable group_replication_recovery_reconnect_interval范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 60最小值Minimum Value 0最大值Maximum Value 31536000单位Unit 秒seconds 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_reconnect_interval指定在没有在组中找到合适的捐赠者进行分布式恢复时,重连尝试之间的休眠时间(以秒为单位)。group_replication_recovery_reconnect_intervalspecifies the sleep time, in seconds, between reconnection attempts when no suitable donor was found in the group for distributed recovery.group_replication_recovery_retry_count命令行格式Command-Line Format --group-replication-recovery-retry-count=#系统变量System Variable group_replication_recovery_retry_count范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 10最小值Minimum Value 0最大值Maximum Value 31536000此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_retry_count指定加入的成员在放弃之前尝试连接可用捐赠者进行分布式恢复的次数。group_replication_recovery_retry_countspecifies the number of times that the member that is joining tries to connect to the available donors for distributed recovery before giving up.group_replication_recovery_ssl_ca命令行格式Command-Line Format --group-replication-recovery-ssl-ca=value系统变量System Variable group_replication_recovery_ssl_ca范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_ca指定包含用于分布式恢复连接的受信任 SSL 证书颁发机构列表的文件路径。有关配置分布式恢复的 SSL 信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。group_replication_recovery_ssl_caspecifies the path to a file that contains a list of trusted SSL certificate authorities for distributed recovery connections. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.如果此服务器已设置为支持克隆(参见 第 20.5.4.2 节,“分布式恢复克隆”),并且您已将
group_replication_recovery_use_ssl设置为ON,则群组复制会自动将克隆 SSL 选项clone_ssl_ca的设置配置为与您对group_replication_recovery_ssl_ca的设置匹配。If this server has been set up to support cloning (see Section 20.5.4.2, “Cloning for Distributed Recovery”), and you have setgroup_replication_recovery_use_ssltoON, Group Replication automatically configures the setting for the clone SSL optionclone_ssl_cato match your setting forgroup_replication_recovery_ssl_ca.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_ssl_capath命令行格式Command-Line Format --group-replication-recovery-ssl-capath=value系统变量System Variable group_replication_recovery_ssl_capath范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_capath指定包含受信任 SSL 证书颁发机构证书的目录路径,用于分布式恢复连接。有关配置分布式恢复的 SSL 信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护群组通信连接”。group_replication_recovery_ssl_capathspecifies the path to a directory that contains trusted SSL certificate authority certificates for distributed recovery connections. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_ssl_cert命令行格式Command-Line Format --group-replication-recovery-ssl-cert=value--group-replication-recovery-ssl-cert=value系统变量System Variable group_replication_recovery_ssl_cert范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_cert指定用于为分布式恢复建立安全连接的 SSL 证书文件的名称。有关配置分布式恢复 SSL 的信息,请参阅 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。group_replication_recovery_ssl_certspecifies the name of the SSL certificate file to use for establishing a secure connection for distributed recovery. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.如果此服务器已设置为支持克隆(参见 第 20.5.4.2 节,“用于分布式恢复的克隆”),并且您已将
group_replication_recovery_use_ssl设置为ON,Group Replication 会自动将克隆 SSL 选项clone_ssl_cert的设置配置为与您对group_replication_recovery_ssl_cert的设置匹配。If this server has been set up to support cloning (see Section 20.5.4.2, “Cloning for Distributed Recovery”), and you have setgroup_replication_recovery_use_ssltoON, Group Replication automatically configures the setting for the clone SSL optionclone_ssl_certto match your setting forgroup_replication_recovery_ssl_cert.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_ssl_cipher命令行格式Command-Line Format --group-replication-recovery-ssl-cipher=value--group-replication-recovery-ssl-cipher=value系统变量System Variable group_replication_recovery_ssl_cipher范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_cipher指定用于 SSL 加密的允许密码列表。有关为分布式恢复配置 SSL 的信息,请参见 第 20.6.2 节,“使用安全套接字层(SSL)保护组通信连接”。group_replication_recovery_ssl_cipherspecifies the list of permissible ciphers for SSL encryption. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_ssl_crl命令行格式Command-Line Format --group-replication-recovery-ssl-crl=value系统变量System Variable group_replication_recovery_ssl_crl范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 文件名File name 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_crl指定包含证书撤销列表文件的目录路径。有关为分布式恢复配置 SSL 的信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。group_replication_recovery_ssl_crlspecifies the path to a directory that contains files containing certificate revocation lists. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_ssl_crlpath命令行格式Command-Line Format --group-replication-recovery-ssl-crlpath=value--group-replication-recovery-ssl-crlpath=value系统变量System Variable group_replication_recovery_ssl_crlpath范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 目录名称Directory name 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_crlpath指定包含证书吊销列表文件的目录路径。有关配置分布式恢复的 SSL 信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。group_replication_recovery_ssl_crlpathspecifies the path to a directory that contains files containing certificate revocation lists. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_ssl_key命令行格式Command-Line Format --group-replication-recovery-ssl-key=value系统变量System Variable group_replication_recovery_ssl_key范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_key指定用于建立安全连接的 SSL 密钥文件的名称。有关为分布式恢复配置 SSL 的信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。group_replication_recovery_ssl_keyspecifies the name of the SSL key file to use for establishing a secure connection. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.如果此服务器已设置为支持克隆(参见 第 20.5.4.2 节,“分布式恢复克隆”),并且您已将
group_replication_recovery_use_ssl设置为ON,则群组复制会自动将克隆 SSL 选项clone_ssl_key的设置配置为与您对group_replication_recovery_ssl_key的设置匹配。If this server has been set up to support cloning (see Section 20.5.4.2, “Cloning for Distributed Recovery”), and you have setgroup_replication_recovery_use_ssltoON, Group Replication automatically configures the setting for the clone SSL optionclone_ssl_keyto match your setting forgroup_replication_recovery_ssl_key.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_ssl_verify_server_cert命令行格式Command-Line Format --group-replication-recovery-ssl-verify-server-cert[={OFF|ON}]系统变量System Variable group_replication_recovery_ssl_verify_server_cert范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFF此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_ssl_verify_server_cert指定分布式恢复连接是否应检查捐赠者发送的证书中的服务器通用名称(Common Name)值。有关为分布式恢复配置 SSL 的信息,请参阅 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。group_replication_recovery_ssl_verify_server_certspecifies whether the distributed recovery connection should check the server's Common Name value in the certificate sent by the donor. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_tls_ciphersuites命令行格式Command-Line Format --group-replication-recovery-tls-ciphersuites=value--group-replication-recovery-tls-ciphersuites=value系统变量System Variable group_replication_recovery_tls_ciphersuites范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 默认值Default Value NULL此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_tls_ciphersuites指定在使用 TLSv1.3 进行分布式恢复连接加密时允许的一个或多个加密套件的冒号分隔列表,并且当该服务器实例在分布式恢复连接中作为客户端(即参与成员)时使用。如果在使用 TLSv1.3 时将此系统变量设置为NULL(如果不设置此系统变量,默认即为 NULL),则允许使用默认启用的加密套件,如 第 8.3.2 节,‘加密连接 TLS 协议和加密套件’ 所列。如果将此系统变量设置为空字符串,则不允许任何加密套件,因此不使用 TLSv1.3。有关配置分布式恢复的 SSL 信息,请参见 第 20.6.2 节,“使用安全套接字层(SSL)保护组通信连接”。group_replication_recovery_tls_ciphersuitesspecifies a colon-separated list of one or more permitted ciphersuites when TLSv1.3 is used for connection encryption for the distributed recovery connection, and this server instance is the client in the distributed recovery connection, that is, the joining member. If this system variable is set toNULLwhen TLSv1.3 is used (which is the default if you do not set the system variable), the ciphersuites that are enabled by default are allowed, as listed in Section 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”. If this system variable is set to the empty string, no cipher suites are allowed, and TLSv1.3 is therefore not used. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)”, for information on configuring SSL for distributed recovery.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.group_replication_recovery_tls_version命令行格式Command-Line Format --group-replication-recovery-tls-version=value--group-replication-recovery-tls-version=value系统变量System Variable group_replication_recovery_tls_version范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 默认值Default Value TLSv1.2,TLSv1.3此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_tls_version指定一个以逗号分隔的允许的 TLS 协议列表,用于在此服务器实例作为分布式恢复连接中的客户端(即加入成员)时进行连接加密。在每个分布式恢复连接中,作为客户端(加入成员)和服务器(捐赠者)的组成员会协商它们都支持的最高协议版本。group_replication_recovery_tls_versionspecifies a comma-separated list of one or more permitted TLS protocols for connection encryption when this server instance is the client in the distributed recovery connection, that is, the joining member. The group members involved in each distributed recovery connection as the client (joining member) and server (donor) negotiate the highest protocol version that they are both set up to support.当组使用 MySQL 通信栈时(
group_replication_communication_stack = MYSQL),此设置用于组通信连接以及分布式恢复连接的 TLS/SSL 配置。When the MySQL communication stack is in use for the group (group_replication_communication_stack = MYSQL), this setting is used for the TLS/SSL configuration for group communication connections, as well as for distributed recovery connections.默认值为 “
TLSv1.2,TLSv1.3”。确保指定的协议版本是连续的,中间不要跳过任何版本号。The default is “TLSv1.2,TLSv1.3”. Ensure that the specified protocol versions are contiguous, with no versions numbers skipped from the middle of the sequence.ImportantMySQL 在 MySQL 8.0 中已弃用并移除了对 TLSv1 和 TLSv1.1 连接协议的支持。更多信息请参见 TLSv1 和 TLSv1.1 协议支持移除。Support for the TLSv1 and TLSv1.1 connection protocols was deprecated in and later removed from MySQL in MySQL 8.0. See Removal of Support for the TLSv1 and TLSv1.1 Protocols for more information.
MySQL 8.4 支持 TLSv1.3 协议,前提是 MySQL 使用 OpenSSL 1.1.1 编译。服务器在启动时会检查 OpenSSL 的版本,如果低于 1.1.1,TLSv1.3 会从系统变量的默认值中移除。在这种情况下,默认值为
TLSv1.2。Support for the TLSv1.3 protocol is available in MySQL 8.4, provided that MySQL was compiled using OpenSSL 1.1.1. The server checks the version of OpenSSL at startup, and if it is lower than 1.1.1, TLSv1.3 is removed from the default value for the system variable. In that case, the default isTLSv1.2.组复制支持 TLSv1.3 并支持密码套件选择。有关更多信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。Group Replication supports TLSv1.3 with support for ciphersuite selection. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for more information.
有关为分布式恢复配置 SSL 的信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.
group_replication_recovery_use_ssl命令行格式Command-Line Format --group-replication-recovery-use-ssl[={OFF|ON}]系统变量System Variable group_replication_recovery_use_ssl范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value OFFOFF此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_use_ssl指定组复制成员之间的分布式恢复连接是否应使用 SSL。有关为分布式恢复配置 SSL 的信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。group_replication_recovery_use_sslspecifies whether Group Replication distributed recovery connections between group members should use SSL or not. See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for distributed recovery.如果该服务器已设置为支持克隆(请参见第 20.5.4.2 节,“分布式恢复的克隆”),并且你将此选项设置为
ON,则组复制在远程克隆操作以及从捐赠者的二进制日志进行状态传输时使用 SSL。如果你将此选项设置为OFF,组复制在远程克隆操作时不使用 SSL。If this server has been set up to support cloning (see Section 20.5.4.2, “Cloning for Distributed Recovery”), and you set this option toON, Group Replication uses SSL for remote cloning operations as well as for state transfer from a donor's binary log. If you set this option toOFF, Group Replication does not use SSL for remote cloning operations.group_replication_recovery_zstd_compression_level命令行格式Command-Line Format --group-replication-recovery-zstd-compression-level=#系统变量System Variable group_replication_recovery_zstd_compression_level范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 3最小值Minimum Value 1最大值Maximum Value 22此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_recovery_zstd_compression_level指定用于使用zstd压缩算法的组复制分布式恢复连接的压缩级别。允许的级别从 1 到 22,数值越大表示压缩程度越高。默认的zstd压缩级别为 3。对于不使用zstd压缩的分布式恢复连接,此变量无效。group_replication_recovery_zstd_compression_levelspecifies the compression level to use for Group Replication distributed recovery connections that use thezstdcompression algorithm. The permitted levels are from 1 to 22, with larger values indicating increasing levels of compression. The defaultzstdcompression level is 3. For distributed recovery connections that do not usezstdcompression, this variable has no effect.更多信息,请参阅 第 6.2.8 节,“连接压缩控制”。For more information, see Section 6.2.8, “Connection Compression Control”.
group_replication_single_primary_mode命令行格式Command-Line Format --group-replication-single-primary-mode[={OFF|ON}]系统变量System Variable group_replication_single_primary_mode范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value ONONNote此系统变量是组范围的配置设置,更改生效需要对复制组进行完全重启。This system variable is a group-wide configuration setting, and a full reboot of the replication group is required for a change to take effect.
group_replication_single_primary_mode指示组自动选择一个服务器来处理读/写工作负载。该服务器为主服务器,其他所有服务器为从服务器。group_replication_single_primary_modeinstructs the group to pick a single server automatically to be the one that handles read/write workload. This server is the primary and all others are secondaries.此系统变量是一个组范围的配置设置。它在所有组成员上必须具有相同的值,组复制运行时无法更改,并且需要对整个组进行完全重启(由启用了
group_replication_bootstrap_group=ON的服务器引导)才能使值更改生效。有关如何在事务已执行并认证的情况下安全引导组的说明,请参阅 第 20.5.2 节,“重启一个组”。This system variable is a group-wide configuration setting. It must have the same value on all group members, cannot be changed while Group Replication is running, and requires a full reboot of the group (a bootstrap by a server withgroup_replication_bootstrap_group=ON) in order for the value change to take effect. For instructions to safely bootstrap a group where transactions have been executed and certified, see Section 20.5.2, “Restarting a Group”.如果该组为此系统变量设置了值,而加入的成员为该系统变量设置了不同的值,则加入的成员在将值更改为匹配之前无法加入该组。如果组成员为此系统变量设置了值,而加入的成员不支持该系统变量,则它无法加入该组。If the group has a value set for this system variable, and a joining member has a different value set for the system variable, the joining member cannot join the group until the value is changed to match. If the group members have a value set for this system variable, and the joining member does not support the system variable, it cannot join the group.
将此变量设置为
ON会导致忽略对group_replication_auto_increment_increment的任何设置。Setting this variableONcauses any setting forgroup_replication_auto_increment_incrementto be ignored.在组仍在运行时,使用函数
group_replication_switch_to_single_primary_mode()和group_replication_switch_to_multi_primary_mode()来更改此系统变量的值。更多信息,请参见 节 20.5.1.2,“更改组模式”。Use the functionsgroup_replication_switch_to_single_primary_mode()andgroup_replication_switch_to_multi_primary_mode()to change the value of this system variable while the group is still running. For more information, see Section 20.5.1.2, “Changing the Group Mode”.命令行格式Command-Line Format --group-replication-ssl-mode=value系统变量System Variable group_replication_ssl_mode范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 枚举Enumeration 默认值Default Value DISABLEDDISABLED有效值Valid Values DISABLEDDISABLEDREQUIREDREQUIREDVERIFY_CAVERIFY_CAVERIFY_IDENTITYVERIFY_IDENTITY此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_ssl_mode设置 Group Replication 成员之间组通信连接的安全状态。可能的值如下:group_replication_ssl_modesets the security state of group communication connections between Group Replication members. The possible values are as follows:- 禁用 DISABLED
建立未加密连接(默认)。Establish an unencrypted connection (the default).
- 必需 REQUIRED
如果服务器支持安全连接,则建立安全连接。Establish a secure connection if the server supports secure connections.
- 验证 CA VERIFY_CA
类似于
REQUIRED,但额外验证服务器的 TLS 证书与配置的证书颁发机构 (CA) 证书。LikeREQUIRED, but additionally verify the server TLS certificate against the configured Certificate Authority (CA) certificates.- 验证身份 VERIFY_IDENTITY
类似
VERIFY_CA,但另外会验证服务器证书是否与尝试连接的主机匹配。LikeVERIFY_CA, but additionally verify that the server certificate matches the host to which the connection is attempted.
该变量在组的所有成员上应具有相同的值;否则,新成员可能无法加入。This variable should have the same value on all members of the group; otherwise, new members may be unable to join.
有关配置组通信的 SSL 信息,请参见 第 20.6.2 节,“使用安全套接字层 (SSL) 保护组通信连接”。See Section 20.6.2, “Securing Group Communication Connections with Secure Socket Layer (SSL)” for information on configuring SSL for group communication.
group_replication_start_on_boot命令行格式Command-Line Format --group-replication-start-on-boot[={OFF|ON}]系统变量System Variable group_replication_start_on_boot范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 布尔Boolean 默认值Default Value ONON此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_start_on_boot指定服务器在启动时是否应自动启动组复制(ON)或不启动(OFF)。当您将此选项设置为ON时,使用远程克隆操作进行分布式恢复后,组复制会自动重新启动。group_replication_start_on_bootspecifies whether the server should start Group Replication automatically (ON) or not (OFF) during server start. When you set this option toON, Group Replication restarts automatically after a remote cloning operation is used for distributed recovery.要在服务器启动时自动启动组复制,分布式恢复的用户凭据必须使用
CHANGE REPLICATION SOURCE TO语句存储在服务器上的复制元数据仓库中。如果您希望在START GROUP_REPLICATION中指定用户凭据(该方法仅将用户凭据存储在内存中),请确保group_replication_start_on_boot设置为OFF。To start Group Replication automatically during server start, the user credentials for distributed recovery must be stored in the replication metadata repositories on the server using theCHANGE REPLICATION SOURCE TOstatement. If you prefer to specify user credentials as part ofSTART GROUP_REPLICATION, which stores the user credentials in memory only, ensure thatgroup_replication_start_on_bootis set toOFF.命令行格式Command-Line Format --group-replication-tls-source=value系统变量System Variable group_replication_tls_source范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 枚举Enumeration 默认值Default Value mysql_main有效值Valid Values mysql_mainmysql_admin此系统变量的值可以在组复制运行时更改,但更改只有在停止并重新启动组成员上的组复制后才会生效。The value of this system variable can be changed while Group Replication is running, but the change takes effect only after you stop and restart Group Replication on the group member.
group_replication_tls_source指定 Group Replication 的 TLS 材料来源。group_replication_tls_sourcespecifies the source of TLS material for Group Replication.group_replication_transaction_size_limit命令行格式Command-Line Format --group-replication-transaction-size-limit=#系统变量System Variable group_replication_transaction_size_limit范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 150000000最小值Minimum Value 0最大值Maximum Value 2147483647单位Unit 字节bytes 这个系统变量在所有组成员上应该有相同的值。该系统变量的值可以在组复制运行时更改。更改会立即在组成员上生效,并从该成员上开始的下一个事务起应用。在此过程中,系统变量的值允许在组成员之间有所不同,但某些事务可能会被拒绝。This system variable should have the same value on all group members. The value of this system variable can be changed while Group Replication is running. The change takes effect immediately on the group member, and applies from the next transaction started on that member. During this process, the value of the system variable is permitted to differ between group members, but some transactions might be rejected.
group_replication_transaction_size_limit配置复制组接受的最大事务大小(以字节为单位)。大于此大小的事务将由接收成员回滚,并且不会广播到组中。大事务可能会给复制组带来问题,例如内存分配问题,这可能导致系统变慢,或网络带宽消耗问题,这可能会导致某个成员被怀疑发生故障,因为它正在处理大事务。group_replication_transaction_size_limitconfigures the maximum transaction size in bytes which the replication group accepts. Transactions larger than this size are rolled back by the receiving member and are not broadcast to the group. Large transactions can cause problems for a replication group in terms of memory allocation, which can cause the system to slow down, or in terms of network bandwidth consumption, which can cause a member to be suspected of having failed because it is busy processing the large transaction.当此系统变量设置为 0 时,组接受的事务大小没有限制。默认值为 150000000 字节(约 143 MB)。根据您希望组能够容忍的最大消息大小调整此系统变量的值,请记住,处理事务所需的时间与其大小成正比。所有组成员上的
group_replication_transaction_size_limit的值应相同。有关大事务的进一步缓解策略,请参见 第 20.3.2 节,“组复制限制”。When this system variable is set to 0 there is no limit to the size of transactions the group accepts. The default is 150000000 bytes (approximately 143 MB). Adjust the value of this system variable depending on the maximum message size that you need the group to tolerate, bearing in mind that the time taken to process a transaction is proportional to its size. The value ofgroup_replication_transaction_size_limitshould be the same on all group members. For further mitigation strategies for large transactions, see Section 20.3.2, “Group Replication Limitations”.group_replication_unreachable_majority_timeout命令行格式Command-Line Format --group-replication-unreachable-majority-timeout=#系统变量System Variable group_replication_unreachable_majority_timeout范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 整数Integer 默认值Default Value 0最小值Minimum Value 0最大值Maximum Value 31536000单位Unit 秒seconds 此系统变量的值可以在组复制运行时更改,并且更改会立即生效。当发生需要该行为的问题时,会读取系统变量的当前值。The value of this system variable can be changed while Group Replication is running, and the change takes effect immediately. The current value of the system variable is read when an issue occurs that means the behavior is needed.
group_replication_unreachable_majority_timeout指定那些遭遇网络分区而无法连接到大多数成员的成员,在离开组之前等待的秒数。在一个由 5 台服务器 (S1,S2,S3,S4,S5) 组成的组中,如果 (S1,S2) 与 (S3,S4,S5) 之间断开连接,就会出现网络分区。第一个组 (S1,S2) 现在处于少数,因为它无法联系到超过半数的组成员。当大多数组 (S3,S4,S5) 仍然运行时,少数组会等待指定的时间以重新建立网络连接。有关该场景的详细描述,请参阅 第 20.7.8 节,“处理网络分区和仲裁丢失”。group_replication_unreachable_majority_timeoutspecifies a number of seconds for which members that suffer a network partition and cannot connect to the majority wait before leaving the group. In a group of 5 servers (S1,S2,S3,S4,S5), if there is a disconnection between (S1,S2) and (S3,S4,S5) there is a network partition. The first group (S1,S2) is now in a minority because it cannot contact more than half of the group. While the majority group (S3,S4,S5) remains running, the minority group waits for the specified time for a network reconnection. For a detailed description of this scenario, see Section 20.7.8, “Handling a Network Partition and Loss of Quorum”.默认情况下,
group_replication_unreachable_majority_timeout设置为 0,这意味着由于网络分区而处于少数的成员会无限期等待离开组。如果设置了超时时间,当指定时间到期时,少数成员处理的所有待处理事务都会回滚,少数分区中的服务器会进入ERROR状态。如果成员设置了group_replication_autorejoin_tries系统变量以指定自动重新加入尝试次数,它将在超级只读模式下进行指定次数的尝试以重新加入组。如果成员没有指定任何自动重新加入尝试次数,或者已用尽指定次数的尝试,它将执行系统变量group_replication_exit_state_action指定的操作。By default,group_replication_unreachable_majority_timeoutis set to 0, which means that members that find themselves in a minority due to a network partition wait forever to leave the group. If you set a timeout, when the specified time elapses, all pending transactions processed by the minority are rolled back, and the servers in the minority partition move to theERRORstate. If a member has thegroup_replication_autorejoin_triessystem variable set to specify a number of auto-rejoin attempts, it proceeds to make the specified number of attempts to rejoin the group while in super read only mode. If the member does not have any auto-rejoin attempts specified, or if it has exhausted the specified number of attempts, it follows the action specified by the system variablegroup_replication_exit_state_action.Warning当你有一个对称组,例如只有两个成员(S0, S2)时,如果发生网络分区且没有多数成员,在配置的超时之后,所有成员都会进入
ERROR状态。When you have a symmetric group, with just two members for example (S0,S2), if there is a network partition and there is no majority, after the configured timeout all members enter theERRORstate.有关使用此选项的更多信息,请参见第 20.7.7.2 节,“无法访问的多数超时”。For more information on using this option, see Section 20.7.7.2, “Unreachable Majority Timeout”.
group_replication_view_change_uuid命令行格式Command-Line Format --group-replication-view-change-uuid=value已弃用Deprecated 是Yes 系统变量System Variable group_replication_view_change_uuid范围Scope 全球Global 动态Dynamic 是Yes SET_VAR提示适用SET_VARHint Applies否No 类型Type 字符串String 默认值Default Value AUTOMATICAUTOMATICNote此系统变量是组范围的配置设置,更改生效需要对复制组进行完全重启。This system variable is a group-wide configuration setting, and a full reboot of the replication group is required for a change to take effect.
group_replication_view_change_uuid指定作为由组生成的视图更改事件的 GTID 标识符中 UUID 部分的替代 UUID。替代 UUID 使这些内部生成的事务容易区分于从客户端接收到的事务。如果您的设置允许组之间的故障切换,并且您需要识别并丢弃特定于备用组的事务,这会非常有用。此系统变量的默认值为AUTOMATIC,这意味着视图更改事件的 GTID 使用group_replication_group_name系统变量指定的组名,与来自客户端的事务一样。在没有此系统变量的版本中,组成员被视为具有AUTOMATIC值。group_replication_view_change_uuidspecifies an alternative UUID to use as the UUID part of the identifier in the GTIDs for view change events generated by the group. The alternative UUID makes these internally generated transactions easy to distinguish from transactions received by the group from clients. This can be useful if your setup allows for failover between groups, and you need to identify and discard transactions that were specific to the backup group. The default value for this system variable isAUTOMATIC, meaning that the GTIDs for view change events use the group name specified by thegroup_replication_group_namesystem variable, as transactions from clients do. Group members at a release that does not have this system variable are treated as having the valueAUTOMATIC.备用 UUID 必须不同于由
group_replication_group_name系统变量指定的组名,并且必须不同于任何组成员的服务器 UUID。它还必须不同于在该拓扑中的任何复制通道上对匿名事务应用的 GTID 中使用的任何 UUID,这些 GTID 使用ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS语句的CHANGE REPLICATION SOURCE TO选项。The alternative UUID must be different from the group name specified by thegroup_replication_group_namesystem variable, and it must be different from the server UUID of any group member. It must also be different from any UUIDs used in the GTIDs that are applied to anonymous transactions on replication channels anywhere in this topology, using theASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONSoption of theCHANGE REPLICATION SOURCE TOstatement.此系统变量是一个组范围的配置设置。它在所有组成员上必须具有相同的值,组复制运行时无法更改,并且需要对整个组进行完全重启(由启用了
group_replication_bootstrap_group=ON的服务器引导)才能使值更改生效。有关如何在事务已执行并认证的情况下安全引导组的说明,请参阅 第 20.5.2 节,“重启一个组”。This system variable is a group-wide configuration setting. It must have the same value on all group members, cannot be changed while Group Replication is running, and requires a full reboot of the group (a bootstrap by a server withgroup_replication_bootstrap_group=ON) in order for the value change to take effect. For instructions to safely bootstrap a group where transactions have been executed and certified, see Section 20.5.2, “Restarting a Group”.如果该组为此系统变量设置了值,而加入的成员为该系统变量设置了不同的值,则加入的成员在将值更改为匹配之前无法加入该组。如果组成员为此系统变量设置了值,而加入的成员不支持该系统变量,则它无法加入该组。If the group has a value set for this system variable, and a joining member has a different value set for the system variable, the joining member cannot join the group until the value is changed to match. If the group members have a value set for this system variable, and the joining member does not support the system variable, it cannot join the group.
视图更改事件的日志记录已被恢复元数据共享取代;因此,该变量已被弃用,并且可能在未来版本的 MySQL 中移除。Logging of view change events is replaced by sharing of recovery metadata; thus, this variable is deprecated, and subject to removal in a future version of MySQL.