Differences
This shows you the differences between two versions of the page.
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. | + | 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. |
Feel free to improve with logging etc. | Feel free to improve with logging etc. | ||
Line 19: | Line 19: | ||
MYSQLPARAMS="" | MYSQLPARAMS="" | ||
- | #who should my master | + | #who should my master |
case " | case " | ||
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:`" = " | ||
+ | echo $REMAINING is still there | ||
+ | change_master_to $REMAINING | ||
+ | fi | ||
else | else | ||
change_master_to $MYMASTER | change_master_to $MYMASTER |