Group Replication 组成员的状态显示其在组中的当前角色。性能模式表 replication_group_members 显示组中每个成员的状态。如果组功能正常并且所有成员之间通信正常,所有成员都会报告所有其他成员的相同状态。然而,已经离开组或处于网络分区的成员无法报告其他服务器的准确信息。在这种情况下,该成员不会尝试猜测其他服务器的状态,而是将其报告为不可达。The state of a Group Replication group member shows its current
role in the group. The Performance Schema table
replication_group_members shows the
state for each member in a group. If the group is fully functional
and all members are communicating properly, all members report the
same state for all other members. However, a member that has left
the group or is part of a network partition cannot report accurate
information on the other servers. In this situation, the member
does not attempt to guess the status of the other servers, and
instead reports them as unreachable.
组成员可以处于以下状态:A group member can be in the following states:
-
ONLINEONLINE 服务器是组的活跃成员,并处于完全正常运行状态。其他组成员可以连接它,如果适用,客户端也可以连接。一个成员只有在处于
ONLINE状态时,才与组完全同步并参与其中。The server is an active member of a group and in a fully functioning state. Other group members can connect to it, as can clients if applicable. A member is only fully synchronized with the group, and participating in it, when it is in theONLINEstate.-
RECOVERING 服务器已加入组,并正在成为活跃成员的过程中。当前正在进行分布式恢复,成员正在通过远程克隆操作或捐赠者的二进制日志从捐赠者接收状态转移。此状态是The server has joined a group and is in the process of becoming an active member. Distributed recovery is currently taking place, where the member is receiving state transfer from a donor using a remote cloning operation or the donor's binary log. This state is
欲了解更多信息,请参见 第 20.5.4 节,“分布式恢复”。For more information, see Section 20.5.4, “Distributed Recovery”.
-
OFFLINE 组复制插件已加载,但成员未加入任何组。在成员加入或重新加入组的过程中,该状态可能会短暂出现。The Group Replication plugin is loaded but the member does not belong to any group. This status may briefly occur while a member is joining or rejoining a group.
-
ERRORERROR 成员处于错误状态,作为组成员无法正常运行。成员可能在应用事务或恢复阶段进入错误状态。处于此状态的成员不会参与组的事务。有关错误状态可能原因的更多信息,请参阅 第 20.7.7 节,“对故障检测和网络分区的响应”。The member is in an error state and is not functioning correctly as a group member. A member can enter error state either while applying transactions or during the recovery phase. A member in this state does not participate in the group's transactions. For more information on possible reasons for error states, see Section 20.7.7, “Responses to Failure Detection and Network Partitioning”.
根据
group_replication_exit_state_action设置的退出操作,该成员处于只读模式 (super_read_only=ON),也可能处于离线模式 (offline_mode=ON)。请注意,处于离线模式并执行OFFLINE_MODE退出操作的服务器显示为ERROR状态,而不是OFFLINE。执行ABORT_SERVER退出操作的服务器将关闭,并从组的视图中移除。更多信息,请参见 第 20.7.7.4 节,“退出操作”。Depending on the exit action set bygroup_replication_exit_state_action, the member is in read-only mode (super_read_only=ON) and could also be in offline mode (offline_mode=ON). Note that a server in offline mode following theOFFLINE_MODEexit action is displayed withERRORstatus, notOFFLINE. A server with the exit actionABORT_SERVERshuts down and is removed from the view of the group. For more information, see Section 20.7.7.4, “Exit Action”.当一个成员正在加入或重新加入复制组时,在该组完成兼容性检查并接纳该成员之前,其状态可能显示为
ERROR。While a member is joining or rejoining a replication group, its status can be displayed asERRORbefore the group completes the compatibility checks and accepts it as a member.-
UNREACHABLE 本地故障检测器怀疑该成员无法联系到,因为组的消息超时了。例如,如果某个成员非自愿断开连接,就可能发生这种情况。如果你在其他服务器上看到此状态,也可能意味着你查询此表的成员属于一个分区,其中一部分组服务器可以互相联系,但无法联系组中的其他服务器。更多信息,请参见 第 20.7.8 节,“处理网络分区和丧失法定人数”。The local failure detector suspects that the member cannot be contacted, because the group's messages are timing out. This can happen if a member is disconnected involuntarily, for example. If you see this status for other servers, it can also mean that the member where you query this table is part of a partition, where a subset of the group's servers can contact each other but cannot contact the other servers in the group. For more information, see Section 20.7.8, “Handling a Network Partition and Loss of Quorum”.
请参阅 第 20.4.3 节,“replication_group_members 表”,了解 Performance Schema 表内容的示例。See Section 20.4.3, “The replication_group_members Table” for an example of the Performance Schema table contents.