Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mysql-circular-replication-automated-handling [2008/10/24 21:22]
93.103.1.78
mysql-circular-replication-automated-handling [2012/07/31 12:46] (current)
greebo old revision restored
Line 1: Line 1:
-Circular multimaster replication is poorly documented in the mysql circles. So putting together a script like this requires a lot of info hunting and testing. Still, I can't guarantee it won't eat your data ;)+Circular multimaster replication is poorly documented in the mysql circles. So putting together a script like this requires a lot of info hunting and testing. Right now it survives sql-bench with random node shutdownsbut I can't guarantee it won't eat your data ;)
 Feel free to improve with logging etc. Feel free to improve with logging etc.
  
Line 19: Line 19:
 MYSQLPARAMS="" MYSQLPARAMS=""
  
-#who should my master by+#who should my master be
  
 case "`hostname`" in case "`hostname`" in
Line 148: Line 148:
         then         then
                 echo but $MYMASTER is not yet back                 echo but $MYMASTER is not yet back
 +                #also check the current master
 +                check_current_master
 +                if [ $? -ne 0 ]
 +                then
 +                        #uhh now what
 +                        [ "`echo $MASTERLIST | cut -f1 -d:`" = "`get_master_host`" ] && REMAINING="`echo $MASTERLIST | cut -f2 -d:`" || REMAINING="`echo $MASTERLIST | cut -f1 -d:`"
 +                        echo $REMAINING is still there
 +                        change_master_to $REMAINING
 +                fi
         else         else
                 change_master_to $MYMASTER                 change_master_to $MYMASTER
mysql-circular-replication-automated-handling.1224876178.txt.gz ยท Last modified: 2009/05/25 00:34 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready