您可以使用 MySQL Performance Schema 来监控组复制。这些 Performance Schema 表显示与组复制相关的信息:You can use the MySQL Performance Schema to monitor Group Replication. These Performance Schema tables display information specific to Group Replication:
replication_group_member_stats:请参见 第 20.4.4 节,“replication_group_member_stats 表”。replication_group_member_stats: See Section 20.4.4, “The replication_group_member_stats Table”.replication_group_members:请参阅 第 20.4.3 节,“replication_group_members 表”。replication_group_members: See Section 20.4.3, “The replication_group_members Table”.replication_group_communication_information:请参阅 第 29.12.11.10 节,“replication_group_communication_information 表”。replication_group_communication_information: See Section 29.12.11.10, “The replication_group_communication_information Table”.
这些性能模式复制表还显示与组复制相关的信息:These Performance Schema replication tables also show information relating to Group Replication:
replication_connection_status显示有关组复制的信息,例如从组接收的事务及在执行队列(中继日志)中排队的事务。replication_connection_statusshows information regarding Group Replication, such as transactions received from the group and queued in the applier queue (relay log).replication_applier_status显示与组复制相关的通道和线程状态。这些也可用于监控各个工作线程的活动情况。replication_applier_statusshows the states of channels and threads relating to Group Replication. These can also be used to monitor what individual worker threads are doing.
由组复制插件创建的复制通道列在此处:Replication channels created by the Group Replication plugin are listed here:
group_replication_recovery:用于与分布式恢复相关的复制更改。group_replication_recovery: Used for replication changes related to distributed recovery.group_replication_applier:用于来自组的传入更改,以应用直接来自组的事务。group_replication_applier: Used for the incoming changes from the group, to apply transactions coming directly from the group.
有关影响组复制的系统变量的信息,请参见第 20.9.1 节,“组复制系统变量”。有关提供有关组复制信息的状态变量,请参见第 20.9.2 节,“组复制状态变量”。For information about system variables affecting Group Replication, see Section 20.9.1, “Group Replication System Variables”. See Section 20.9.2, “Group Replication Status Variables”, for status variables providing information about Group Replication.
与组复制生命周期事件相关的消息(除错误之外)被归类为系统消息;这些消息总是写入复制组成员的错误日志。您可以使用这些信息来查看给定服务器在复制组中的成员历史记录。Messages relating to Group Replication lifecycle events other than errors are classified as system messages; these are always written to the replication group member' error log. You can use this information to review the history of a given server's membership in a replication group.
一些影响整个组的生命周期事件会在每个组成员上记录,例如新成员进入ONLINE状态或进行主节点选举。其他事件仅记录在发生事件的成员上,例如在成员上启用或禁用超级只读模式,或者成员离开组。一些生命周期事件,如果频繁发生可能表明存在问题,会记录为警告消息,包括成员变为不可达然后再次可达,以及成员通过二进制日志状态传输或远程克隆操作启动分布式恢复。Some lifecycle events that affect the whole group are logged on
every group member, such as a new member entering
ONLINE status in the group or a primary election.
Other events are logged only on the member where they take place,
such as super read only mode being enabled or disabled on the
member, or the member leaving the group. A number of lifecycle
events that can indicate an issue if they occur frequently are
logged as warning messages, including a member becoming unreachable
and then reachable again, and a member starting distributed recovery
by state transfer from the binary log or by a remote cloning
operation.
如果您使用 mysqladmin 监控一个或多个从属实例,您应当注意,通过此工具执行的 FLUSH STATUS 语句会在本地实例上创建一个 GTID 事件,这可能会影响未来的组操作。If you are monitoring one or more secondary instances using
mysqladmin, you should be aware that a
FLUSH STATUS statement executed by
this utility creates a GTID event on the local instance which may
impact future group operations.