Home » Performance » MySQL » dump/reload in master-master
dump/reload in master-master [message #2935] Fri, 11 April 2008 18:00 Go to next message
Jjhuff  is currently offline Jjhuff
Messages: 5
Registered: October 2007
Junior Member
It looks like I have some InnoDB corruption on one of my masters in a master-master configuration. My thought was to dump, drop, and reload the data on that server.
What's the best way to do that without messing up the other master?

My thoughts where to:
A = active master, no getting reloaded
B = passive master, getting dumped/reloaded
0. stop slave on B
1. stop slave on A
2. Disable bin_log on the B
3. mysqldump the two databases on B
4. Drop them on B
5. reload them on B
6. Reenable bin_log
7. start slave on A

Is there an easier way?

thanks!
Re: dump/reload in master-master [message #2943 is a reply to message #2935 ] Sun, 13 April 2008 22:28 Go to previous messageGo to next message
debug  is currently offline debug
Messages: 132
Registered: March 2008
Senior Member

Hi,
You can also use maatkit to synchronize data. Please see http://www.maatkit.org/


Mikhail Solovyev, MySQL Performance Expert
MySQL Performance Blog
MySQL Consulting
Re: dump/reload in master-master [message #2949 is a reply to message #2943 ] Mon, 14 April 2008 11:10 Go to previous messageGo to next message
Jjhuff  is currently offline Jjhuff
Messages: 5
Registered: October 2007
Junior Member
That's awesome, thanks!

It appears that the corrupt pages are in some indexes.

Do you think it's enough to run ALTERs on every table and then verify the data with maatkit?

thanks!
Re: dump/reload in master-master [message #2953 is a reply to message #2949 ] Tue, 15 April 2008 00:07 Go to previous message
debug  is currently offline debug
Messages: 132
Registered: March 2008
Senior Member

At first please verify data with mk-table-checksum. It will show if number of records or checksums are different.
After that you can continue using two possible ways:
1) Manually fix the problem (do not forget to do "SET SQL_LOG_BIN=0" before doing any changes, if you do not want them to be replicated to another server. See http://dev.mysql.com/doc/refman/5.0/en/binary-log.html for details about disabling binlog). When you have fixed tables, check them again with mk-table-checksum.
2) Use mk-table-sync for fixing tables. Please read docs carefully, and pay special attention that you also should disable writing to binary log (using --skipbinlog option).


Mikhail Solovyev, MySQL Performance Expert
MySQL Performance Blog
MySQL Consulting
Previous Topic:Tweak Innodb parameters
Next Topic:The Slowness of "WHERE something IN (SELECT....)"
Goto Forum:
  


Current Time: Fri Jul 10 01:28:24 EDT 2009

Total time taken to generate the page: 0.02276 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.