I'm using a maxscale (6.2) readwritesplit router with 3 galera servers (mariadb 10.4). 2 of them are in DC1, and a 3rd one is on a distant DC2.
Using ranks is the only option I see here, as priority
will be used by galeramon to select the master.
My goal is to tell maxscale to use DC1 as much as possible, so server1 as master (priority=1, rank=primary), server2 as slave (priority=2, rank=primary), and use DC2 server3 only if server1 or server2 are not reachable (priority=3, rank=secondary).
Is this the correct behavior?
[server1]
type=server
address=192.168.0.11
priority=1
rank=primary
[server2]
type=server
address=192.168.0.12
priority=2
rank=primary
[server3]
type=server
address=192.168.0.21
priority=3
rank=secondary
[split]
type=service
router=readwritesplit
servers=server1,server2,server3
[monitor]
type=monitor
module=galeramon
servers=server1,server2,server3
root_node_as_master=true
use_priority=true