warning: [mariadbmon] The current master server ‘srv-cls01-02‘ is no longer valid because it is in r
Posted 雅冰石
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了warning: [mariadbmon] The current master server ‘srv-cls01-02‘ is no longer valid because it is in r相关的知识,希望对你有一定的参考价值。
一 问题描述
mariadb有一主两从,示例:
192.168.144.249
192.168.144.250
192.168.144.251
起初249这台服务器是主库,250,251是从(从库开启了read_only),后来发生了一次主从切换,250变成了主库,249,251自动变成了250的从库。后来重启了250,发现maxscale显示三台数据库的状态都是Slave,Running:
看到maxscale日志里有如下报错:
21 2022-06-16 01:00:50 warning: [mariadbmon] The current master server 'srv-cls01-02' is no longer valid because it is in read-only mode, but there is no valid alternative to swap to.
22 2022-06-16 01:00:50 error : [mariadbmon] No Master can be determined. Last known was 192.168.144.250:3306
由于没有了主库,导致业务无法写入数据。
二 出错原因
重启数据库很快,此时还没来得及触发数据库自动故障转移,没能提升从库为主库。而且重启了250数据库,会读取配置文件里的只读配置,所以maxscale不知道谁是主库了,所以三台都是Slave,Running。
三 解决办法
登录数据库,在线改参数配置:
set global read_only=on;
取消数据库mariadb配置文件里的read_only配置。
哎,就是担心同事会直连某个从库(没连maxscale的代理地址)做了修改,导致主从不一致。
暂时想不到其他比较好的办法,大家若有好的办法,烦请告知下O(∩_∩)O。
以上是关于warning: [mariadbmon] The current master server ‘srv-cls01-02‘ is no longer valid because it is in r的主要内容,如果未能解决你的问题,请参考以下文章
warning C4819 解决方案 warning C4819: The file contains a character that cannot be represented in the cu
WARNING: The TCP backlog setting of 511.解决
-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
[转帖]Warning:detected "cgroupfs" as the Docker cgroup driver. The recommended driver is &qu
Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching