maxscale/mariadb 和自动故障转移:访问被拒绝

maxscale/mariadb and automatic failover : Access denied

我正在使用一个简单的 mariadb 架构测试 maxscale 解决方案,一个接收所有请求的主服务器 (server2) 和一个副本 (server1)。复制工作正常,但在主节点停止时,maxscale 报告了一个错误:

2021-08-23 14:36:08   notice : [mariadbmon] Selecting a server to promote and replace 'server2'. Candidates are: 'server1'.
2021-08-23 14:36:08   notice : [mariadbmon] Selected 'server1'.
2021-08-23 14:36:08   notice : [mariadbmon] Performing automatic failover to replace failed master 'server2'.
2021-08-23 14:36:08   error  : [mariadbmon] Failed to stop slave connection on 'server1': Query 'SET STATEMENT max_statement_time=3 FOR STOP SLAVE '';' failed on 'server1': 'Access denied for user 'monitor_user'@'192.168.100.%' (using password: YES)' (1045).
2021-08-23 14:36:08   error  : [mariadbmon] Failed to remove slave connection(s) from 'server1'.
2021-08-23 14:36:08   error  : [mariadbmon] Failover 'server2' -> 'server1' failed.

根据 maxscale github,monitor_user 的拨款是:

> show grants for 'monitor_user'@'192.168.100.%'\G;
*************************** 1. row ***************************
Grants for monitor_user@192.168.100.%: GRANT RELOAD, SUPER, REPLICATION CLIENT ON *.* TO `monitor_user`@`192.168.100.%` IDENTIFIED BY PASSWORD '***'

SET有专项补助吗?我一定错过了什么……有什么想法吗? 谢谢。

编辑 8 月 23 日星期一 15:19:20 UTC 2021:

与MaxScale表示的相反,有必要再增加一个grant:

GRANT REPLICATION SLAVE ON *.* TO 'monitor_user'@'192.168.100.%'