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);