MySQL8.0.21——错误日志中的组复制系统消息

时间:2022-07-26
本文章向大家介绍MySQL8.0.21——错误日志中的组复制系统消息,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

作者:Nuno Carvalho 译:徐轶韬

利用组复制,用户可以通过将系统状态复制到一组服务器来创建具有冗余的容错系统。即使某些服务器发生故障,只要不是所有服务器或大多数服务器,系统仍然可用。

为了使DBA能够在组的生存期内对主要事件进行后期观察,需要完整记录这些事件。在8.0.21之前,用户可以通过增加的错误日志的详细程度来指示服务器执行此操作。现在有一种更简单的方法。

在MySQL 8.0.21上,我们针对组复制日志消息进行了全新的处理,目标是:

MySQL DBA必须能够通过服务器的错误日志来观察组的主要事件,而不管错误日志的详细程度如何。

为此,我们将与组复制相关的日志消息重新分类为系统消息。系统会始终记录该类别消息,而与服务器日志级别无关。 主要故障转移的示例:

2020-07-22T12:31:21.078766Z 0 [Warning] [MY-011493] [Repl] Plugin group_replication reported: 'Member with address 10.0.0.1:3306 has become unreachable.'
2020-07-22T12:31:32.082929Z 0 [Warning] [MY-011499] [Repl] Plugin group_replication reported: 'Members removed from the group: 10.0.0.1:3306'
2020-07-22T12:31:32.082960Z 0 [System] [MY-011500] [Repl] Plugin group_replication reported: 'Primary server with address 10.0.0.1:3306 left the group. Electing new Primary.'
2020-07-22T12:31:33.085475Z 0 [System] [MY-011507] [Repl] Plugin group_replication reported: 'A new primary with address 10.0.0.2:3306 was elected. The new primary will execute all previous group transactions before allowing writes.'
2020-07-22T12:31:54.674725Z 0 [System] [MY-011503] [Repl] Plugin group_replication reported: 'Group membership changed to 10.0.0.2:3306, 10.0.0.3:3306 on view 15767586730861839:4.'
2020-07-22T12:31:54.874627Z 39 [System] [MY-011566] [Repl] Plugin group_replication reported: 'Setting super_read_only=OFF.'
2020-07-22T12:31:54.876002Z 39 [System] [MY-011510] [Repl] Plugin group_replication reported: 'This server is working as primary member.'

改进的最好之处在于,DBA /操作员无需进行任何配置更改。

结论

遵循我们不断改进的传统,通过使用相同的服务器默认值,我们再次简化了组复制的使用。