Open GoogleCodeExporter opened 9 years ago
SET GLOBAL read_only=1 on a new slave (orig master) can be executed from an
external script "master_ip_online_change_script". (see
http://code.google.com/p/mysql-master-ha/wiki/Parameters#master_ip_online_change
_script for details)
The script is invoked before CHANGE MASTER.
When doing online master switch, restricting write access to the orig master is
needed, and the way to do that depends on applications (i.e. moving virtual ip,
updating catalog database, etc). MHA allows developers to customize in
master_ip_online_change_script.
MHA tarball has sample code of master_ip_online_change_script at
samples/scripts/master_ip_online_change. In this sample script, SET GLOBAL
read_only=1 is executed on the orig master
($orig_master_handler->enable_read_only();).
Sample code is written in Perl, but is not language dependent.
Original comment by Yoshinor...@gmail.com
on 4 Jan 2013 at 1:03
Original issue reported on code.google.com by
ronald.b...@gmail.com
on 3 Jan 2013 at 6:23