0

I am testing the maxscale solution with a simple mariadb architecture, a primary (server2) that receives all requests and a replica (server1). Replication is working properly but at the stop of the primary, I have an error reported by 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.

According to the maxscale github, grants for monitor_user are:

> 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 '***'

Is there a special grant for SET ? I must have missed something... any ideas ? Thank you.

Edit Mon Aug 23 15:19:20 UTC 2021:

  • debian buster 10.10
  • mariadb 10.3
  • maxscale 2.5.14
lc63
  • 25
  • 1
  • 4
  • Please include the MariaDB and MaxScale versions: this could help identify what the problem might be. – markusjm Aug 23 '21 at 14:37
  • Yes, an oversight, sorry. – lc63 Aug 23 '21 at 15:21
  • The grants should be OK. If you can execute the same statement directly on the database, the problem is most likely with the user grants. Check the output of `SELECT user, host FROM mysql.user WHERE user = 'monitor_user'` to make sure there's only one user account that matches this. – markusjm Aug 25 '21 at 03:49
  • I ran those queries on the primary (same result on maxscale). Obviously there is only one monitor_user. – lc63 Aug 30 '21 at 08:19

1 Answers1

0

Contrary to what MaxScale indicates, it is necessary to add another grant:

GRANT REPLICATION SLAVE ON *.* TO 'monitor_user'@'192.168.100.%'
lc63
  • 25
  • 1
  • 4