1

Looking over the documentation, I haven't quite been able to find if its possible to manually set the candidate master status of a server in Maxscale. The reason I am looking for this is because some of the slaves we have hooked up the the master/slave server architecture have inferior hardware to the others, and we don't want them to become the master. Looking at the documentation, it is possible to set the status of a sever as master or slave, but not specify that we don't want it to become a master.

Is there a setting to do this in Maxscale? Possibly in maxadmin or a .cnf file or something?

Thanks.

Rick James
  • 80,479
  • 5
  • 52
  • 119
Bif Stone
  • 11
  • 3

3 Answers3

0

This is an old question but at least with recent versions of MaxScale (23.08 in my case) you can use the servers_no_promotion parameter in the monitor definition section of the configuration file.

This is a comma-separated list of server names that will not be chosen for primary promotion during a failover or autoselected for switchover.

For example

servers_no_promotion=slow_server1,slow_server2
orpe
  • 3
  • 1
0

@klutt points to the correct direction but note that the priority and use_priority parameters only work for a Galera cluster. Some elaborations here:

Edit /etc/maxscale.cnf

  1. Assign priority to servers. With the lowest number being the highest priority. But not 0, which means the lowest priority. Servers with priority number smaller than 0 will never be picked as the master.
[server1]
#master node
type=server
address=192.168.0.1
port=3306
priority=1

[server2] type=server address=192.168.0.2 port=3306 priority=2

[server3] type=server address=192.168.0.3 port=3306 priority=3

  1. Under monitor block, add use_priority=true and disable_master_role_setting=false
[MariaDB-Monitor]
type=monitor
module=galeramon
servers=server1,server2,server3
user=%username%
password=%password%
monitor_interval=4s
use_priority=true
disable_master_role_setting=false
  1. Restart maxscale by running systemctl restart maxscale and server1 which has the highest priority, will be the default master.
orpe
  • 3
  • 1
-1

You can use priorities as described here: https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale/maxscale-galera-monitor/

klutt
  • 1