使用统计信息来检测集群中的复制延迟

使用集群货币统计信息可帮助主动发现集群中的数据库复制延迟。

过程

在集群中服务器的控制台上输入以下命令以查看统计信息:
show stat replica.cluster.currency.*

一组货币统计信息报告数据库与集群中的其他服务器最后一次进行复制的时间范围。统计信息按服务器分组。

例如,以下输出显示该服务器与一分钟内复制的服务器 Mail2/Renovations 共有的所有98个副本:
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Outside8Hours = 0
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Uninitialized = 0
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Within15Min = 0
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Within1Hour = 0
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Within1Min = 98
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Within4Hours = 0
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Within5Min = 0
[00134C:000008-00000000000004AC]   Replica.Cluster.Currency.Mail2/Renovations.Within8Hours = 0