dump/reload in master-master

  • Filter
  • Time
  • Show
Clear All
new posts

  • dump/reload in master-master

    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?


  • #2
    You can also use maatkit to synchronize data. Please see http://www.maatkit.org/


    • #3
      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?



      • #4
        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).