
Hi, The best way to do this would be to use the Cooperative Monitoring <https://mariadb.com/kb/en/mariadb-maxscale-2106-maxscale-2106-mariadb-monitor/#cooperative-monitoring> feature which will prevent concurrent failovers from happening. It'll also help avoid writes going to stale servers if both MaxScales receive traffic while one of them is doing switchover. The feature has two modes: the cooperative_monitoring_locks=majority_of_all which provides consistency by only allowing writes if more than half of the cluster is available The other mode is cooperative_monitoring_locks=majority_of_running which does allow writes even with a single node (i.e. chooses availability over consistency) but it makes split-brain scenarios possible. Markus On 4/13/25 23:13, Richard Reina via discuss wrote:
I have configured a second Maxscale node and was hoping to use it as a backup in case my other Maxscale node should fail. My question is how do I deploy it? I take it starting it up and having two Maxscale nodes working at the same time would be a problem because the both might try to effectuate failover changes such as promotions simultaneously that could cause conflicts?
I have written the perl code below that can randomly select a node, but it would need two working nodes to choose between. How does one deploy a second node without it conflicting with the first Maxscale node?
my @msn = qw(192.168.0.24 192.168.0.23); # Maxscale Nodes my $msn = $msn[rand @msn]; my $msn = splice(@msn, rand @msn, 1); print "I picked: $msn\n"; print "Remaining Maxscale Nodes are: @msn\n";
$dbh = DBI->connect("DBI:mysql:database=$self->{_db_name};host=$msn;port=4006",$user, $pwd);
_______________________________________________ discuss mailing list --discuss@lists.mariadb.org To unsubscribe send an email todiscuss-leave@lists.mariadb.org
-- Markus Mäkelä, Staff Software Engineer MariaDB plc