作者: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 /操作员无需进行任何配置更改。
遵循我们不断改进的传统,通过使用相同的服务器默认值,我们再次简化了组复制的使用。
本文分享自 MySQL解决方案工程师 微信公众号,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!