mha4mysql-manager icon indicating copy to clipboard operation
mha4mysql-manager copied to clipboard

--orig_master_is_new_slave does not set read_only=1 on the old master

Open jayjanssen opened this issue 11 years ago • 3 comments

The old master stays read_only=OFF and once the UNLOCK TABLES is released clients are still connected there allowing writes on the old master.

jayjanssen avatar May 15 '13 13:05 jayjanssen

This is intended since not all users set read_only=1 on slaves. You can change read_only settings on a custom script (master_ip_online_change). A sample script exists in a MHA Manager tarball.

samples/scripts/master_ip_online_change

Maybe it's worth adding a new argument to execute read_only on the orig master or not.

yoshinorim avatar May 15 '13 15:05 yoshinorim

Yes, I found that, thanks. It was counter-intuitive to me to leave the old master as a slave and not revert the read_only state that MHA manages in the other direction. I guess my ideal here is a configuration parameter that tells MHA to manage read_only or not.

jayjanssen avatar May 15 '13 15:05 jayjanssen

mha-helper can be used to set the old master to read only. It also supports super-read-only: https://github.com/grypyrg/mha-helper

grypyrg avatar Dec 07 '15 12:12 grypyrg