Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
mysql-circular-replication-automated-handling [2008/10/24 21:18] pegasus created |
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 124: | Line 124: | ||
| if [ $? -ne 0 ] | if [ $? -ne 0 ] | ||
| then | then | ||
| - | #looks like we' | + | #looks like we are offline. no master candidate is accessible |
| echo panic | echo panic | ||
| else | else | ||
| 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 | ||

