hieudd121 / mysql-master-ha

Automatically exported from code.google.com/p/mysql-master-ha
0 stars 0 forks source link

is it necessary for setting this parameter "secondary_check_script" in the one and same LAN ? #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In general, it is highly recommended to have two or more network routes to 
check MySQL master server availability.
secondary_check_script = masterha_secondary_check -s remote_host1 -s 
remote_host2

My question as follows:
If all my machine(mysql master,mysql slave ,MHA manager) are in the one and the 
same LAN , is it necessary for setting this parameter?

I think it is not necessary.
I have to make sure that remote_host1 and remote_host2 are alive ,if one is 
dead,at the same time the master node is dead ,MHA failover will not be 
successful because mha manager can not login the remote_host .

What is your opinion about it?

Original issue reported on code.google.com by tiandong...@gmail.com on 1 Aug 2014 at 3:07

GoogleCodeExporter commented 9 years ago
Main purpose of the secondary_check_script is to avoid split brain. Suppose 
there are one master and three slaves, master is in rack1 and slaves are in 
rack 2,3,4. If rack1 is down but master itself is running, MHA decides master 
is dead and starts failover, but if rack1 recovers, there is a risk that 
applications send write traffics to the old master. You need to make sure this 
scenario does not happen. secondary_check_script helps here, by setting -s 
some_host_in_rack_1. In that case MHA fails to connect to the remote host and 
does not start failover. Failover does not start, but this is much better than 
split brain.

Original comment by Yoshinor...@gmail.com on 2 Aug 2014 at 5:15

GoogleCodeExporter commented 9 years ago
Thank your detail explanation,and it have enhanced my understanding of this 
parameter.
Thanks again!

Original comment by tiandong...@gmail.com on 4 Aug 2014 at 2:59