组复制的组成员可以使用 IPv6 地址作为组内通信的 IPv4 地址的替代。要使用 IPv6 地址,服务器主机的操作系统和 MySQL Server 实例都必须配置为支持 IPv6。有关为服务器实例设置 IPv6 支持的说明,请参见 第 7.1.13 节,“IPv6 支持”。Group Replication group members can use IPv6 addresses as an alternative to IPv4 addresses for communications within the group. To use IPv6 addresses, the operating system on the server host and the MySQL Server instance must both be configured to support IPv6. For instructions to set up IPv6 support for a server instance, see Section 7.1.13, “IPv6 Support”.
可以将 IPv6 地址或解析为 IPv6 地址的主机名指定为成员在 group_replication_local_address 选项中提供的网络地址,用于来自其他成员的连接。当与端口号一起指定时,IPv6 地址必须用方括号括起来,例如:IPv6 addresses, or host names that resolve to them, can be
specified as the network address that the member provides in the
group_replication_local_address
option for connections from other members. When specified with a
port number, an IPv6 address must be specified in square brackets,
for example:
group_replication_local_address= "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:33061"
在 group_replication_local_address 中指定的网络地址或主机名被组复制用作复制组中成员的唯一标识符。如果为服务器实例指定的组复制本地地址的主机名解析为 IPv4 和 IPv6 地址,则组复制连接总是使用 IPv4 地址。指定为组复制本地地址的地址或主机名不同于 MySQL 服务器的 SQL 协议主机和端口,并且未在服务器实例的 bind_address 系统变量中指定。为了组复制的 IP 地址权限(参见 第 20.6.4 节,“组复制 IP 地址权限”)的目的,您为每个组成员在 group_replication_local_address 中指定的地址必须添加到复制组中其他服务器的 group_replication_ip_allowlist 系统变量列表中。The network address or host name specified in
group_replication_local_address
is used by Group Replication as the unique identifier for a group
member within the replication group. 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. The address or host name
specified as the Group Replication local address is not the same
as the MySQL server SQL protocol host and port, and is not
specified in the bind_address
system variable for the server instance. For the purpose of IP
address permissions for Group Replication (see
Section 20.6.4, “Group Replication IP Address Permissions”), the
address that you specify for each group member in
group_replication_local_address
must be added to the list for the
group_replication_ip_allowlist
system variable on the other servers in the replication group.
一个复制组可以包含既有以 IPv6 地址作为其组复制本地地址的成员,也有以 IPv4 地址作为本地地址的成员。当服务器加入这样的混合组时,它必须使用种子成员在 group_replication_group_seeds 选项中宣传的协议与种子成员进行初步联系,无论该协议是 IPv4 还是 IPv6。如果组的任何种子成员在 group_replication_group_seeds 选项中以 IPv6 地址列出,而加入的成员使用的是 IPv4 组复制本地地址,或者反过来,则必须为加入的成员设置并允许一个用于所需协议的备用地址(或者是解析到该协议地址的主机名)。如果加入的成员没有该适当协议的允许地址,其连接尝试将被拒绝。备用地址或主机名只需添加到复制组中其他服务器的 group_replication_ip_allowlist 系统变量,而不需要添加到加入成员的 group_replication_local_address 值(该值只能包含一个地址)。A replication group can contain a combination of members that
present an IPv6 address as their Group Replication local address,
and members that present an IPv4 address. When a server joins such
a mixed group, it must make the initial contact with the seed
member using the protocol that the seed member advertises in the
group_replication_group_seeds
option, whether that is IPv4 or IPv6. If any of the seed members
for the group are listed in the
group_replication_group_seeds
option with an IPv6 address when a joining member has an IPv4
Group Replication local address, or the reverse, you must also set
up and permit an alternative address for the joining member for
the required protocol (or a host name that resolves to an address
for that protocol). If a joining member does not have a permitted
address for the appropriate protocol, its connection attempt is
refused. The alternative address or host name only needs to be
added to the
group_replication_ip_allowlist
system variable on the other servers in the replication group, not
to the
group_replication_local_address
value for the joining member (which can only contain a single
address).
例如,服务器 A 是某个组的种子成员,并且为组复制配置了以下设置,从而在 group_replication_group_seeds 选项中发布了一个 IPv6 地址:For example, server A is a seed member for a group, and has the
following configuration settings for Group Replication, so that it
is advertising an IPv6 address in the
group_replication_group_seeds
option:
group_replication_bootstrap_group=on group_replication_local_address= "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:33061" group_replication_group_seeds= "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:33061"
服务器 B 是该组的新加入成员,并且为组复制配置了以下设置,从而拥有一个 IPv4 组复制本地地址:Server B is a joining member for the group, and has the following configuration settings for Group Replication, so that it has an IPv4 Group Replication local address:
group_replication_bootstrap_group=off group_replication_local_address= "203.0.113.21:33061" group_replication_group_seeds= "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:33061"
服务器 B 还有一个备用 IPv6 地址 2001:db8:8b0:40:3d9c:cc43:e006:19e8。为了使服务器 B 成功加入该组,它的 IPv4 组复制本地地址和备用 IPv6 地址都必须列在服务器 A 的允许列表中,如下例所示:Server B also has an alternative IPv6 address
2001:db8:8b0:40:3d9c:cc43:e006:19e8. For Server
B to join the group successfully, both its IPv4 Group Replication
local address, and its alternative IPv6 address, must be listed in
Server A's allowlist, as in the following example:
group_replication_ip_allowlist= "203.0.113.0/24,2001:db8:85a3:8d3:1319:8a2e:370:7348, 2001:db8:8b0:40:3d9c:cc43:e006:19e8"
作为群组复制 IP 地址权限的最佳做法,除非安全要求另有规定,服务器 B(以及所有其他群组成员)应与服务器 A 拥有相同的允许列表。As a best practice for Group Replication IP address permissions, Server B (and all other group members) should have the same allowlist as Server A, unless security requirements demand otherwise.
如果复制组的任何成员或所有成员使用不支持在组复制中使用 IPv6 地址的旧版 MySQL 服务器版本,那么该成员无法使用 IPv6 地址(或解析为 IPv6 的主机名)作为其组复制本地地址来参与组复制。这适用于两种情况:一是至少有一个现有成员使用 IPv6 地址,而一个不支持 IPv6 的新成员尝试加入;二是一个新成员尝试使用 IPv6 地址加入,但组中至少有一个成员不支持 IPv6。在每种情况下,新成员都无法加入。要使加入的成员在组通信中提供 IPv4 地址,可以通过以下两种方式之一:将 group_replication_local_address 的值更改为 IPv4 地址,或将 DNS 配置为将加入成员的现有主机名解析为 IPv4 地址。在将每个组成员升级到支持组复制 IPv6 的 MySQL 服务器版本之后,您可以将每个成员的 group_replication_local_address 值更改为 IPv6 地址,或配置 DNS 以提供 IPv6 地址。更改 group_replication_local_address 的值仅在停止并重新启动组复制后生效。If any or all members of a replication group are using an older
MySQL Server version that does not support the use of IPv6
addresses for Group Replication, a member cannot participate in
the group using an IPv6 address (or a host name that resolves to
one) as its Group Replication local address. This applies both in
the case where at least one existing member uses an IPv6 address
and a new member that does not support this attempts to join, and
in the case where a new member attempts to join using an IPv6
address but the group includes at least one member that does not
support this. In each situation, the new member cannot join. To
make a joining member present an IPv4 address for group
communications, you can either change the value of
group_replication_local_address
to an IPv4 address, or configure your DNS to resolve the joining
member's existing host name to an IPv4 address. After you have
upgraded every group member to a MySQL Server version that
supports IPv6 for Group Replication, you can change the
group_replication_local_address
value for each member to an IPv6 address, or configure your DNS to
present an IPv6 address. Changing the value of
group_replication_local_address
takes effect only when you stop and restart Group Replication.
IPv6 地址也可以用作分布式恢复端点,可以使用 group_replication_advertise_recovery_endpoints 系统变量来指定。在此列表中使用的地址适用相同的规则。请参阅 第 20.5.4.1 节,“分布式恢复连接”。IPv6 addresses can also be used as distributed recovery endpoints,
which can be specified using the
group_replication_advertise_recovery_endpoints
system variable. The same rules apply to addresses used in this
list. See
Section 20.5.4.1, “Connections for Distributed Recovery”.