Using Cooperative Locking for HA with MaxScale's MariaDB Monitor
When multiple MaxScale instances are used in a highly available deployment, MariaDB Monitor needs to ensure that only one MaxScale instance performs automatic failover operations at a given time. It does this by using cooperative locks on the back-end servers.
How MariaDB Monitor uses Cooperative Locks
When cooperative locking is enabled for MariaDB Monitor, it tries to acquire locks on the back-end servers with with GET_
Configuring Cooperative Locking
Configure cooperative locking by configuring the cooperative_
monitoring_parameter for the MariaDB Monitor in locks
maxscale.cnf. It has several possible values.
Do not use any cooperative locking. This is the default value.
Primary monitor requires locks on a majority of servers, even those which are down.
Primary monitor requires locks on a majority of running servers.
[repl-cluster] type = monitor module = mariadbmon ... cooperative_monitoring_locks = majority_of_running
Restart the MaxScale instance.
$ sudo systemctl restart maxscale