yoshinorim / mha4mysql-manager

Development tree of Master High Availability Manager and tools for MySQL (MHA), Manager part
http://code.google.com/p/mysql-master-ha/
GNU General Public License v2.0
1.47k stars 500 forks source link

@@global.relay_log_purge should be preserved on change master #10

Closed yoshinorim closed 13 years ago

yoshinorim commented 13 years ago

http://yoshinorimatsunobu.blogspot.com/2011/07/announcing-mysql-mha-mysql-master-high.html#comments

Anonymous said...

I have tried this tool, it's really a great tool in doing the master failover.

I have one question:

In the wiki, the relay_log_purge is suggested to be set to OFF. I did that and start testing the failover. After the failover is successfully done and I checked this parameter again and it's set back to ON.

It means I have to set them to OFF manually before I start the manager next time. Is it designed to be this?
August 24, 2011 6:42 PM 

Yoshinori Matsunobu said...

@Anonymous

relay_log_purge is implicitly turned to ON by MySQL itself sometimes, including when executing CHANGE MASTER. MHA internally executes CHANGE MASTER so relay_log_purge is set to ON. This applies when you execute CHANGE MASTER manually, too.

I can modify MHA Manager to check relay_log_purge parameter before executing CHANGE MASTER and set that value (executing SET GLOBAL relay_log_purge=0 or 1) after executing CHANGE MASTER, but I recommend another approach: Executing relay_log_purge script included in MHA Node package regularly, and setting --disable-relay-log-purge argument. See the online manual for details.

http://code.google.com/p/mysql-master-ha/wiki/Requirements#purge_relay_logs_script

By using this, you can safely remove unneeded relay logs and set relay_log_purge=0 automatically.
August 24, 2011 7:12 PM 
yoshinorim commented 13 years ago

Fix: https://github.com/yoshinorim/MySQL-MasterHA-Manager/commit/83158f9e5219ed538b81f59bef321c00fc4355e7