Changeset 1202
- Timestamp:
- 02/25/10 17:03:46 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/mysql-server/boot-cluster/boot-slave.sh
r1201 r1202 62 62 63 63 #SQL "change master to" parsed data on local slave MySQL server. 64 fLog "cBinLog=$cBinLog cPosition=$cPosition"; 64 65 echo "CHANGE MASTER TO MASTER_LOG_FILE='$cBinLog',MASTER_LOG_POS=$cPosition" | mysql -p$1 > /dev/null 2>&1; 65 66 if [ $? != 0 ];then … … 74 75 exit 6; 75 76 fi 77 sleep 2; 76 78 77 79 #check status. if slave did not catch up in max iTimeoutSecs send warning email, exit error. … … 81 83 exit 7; 82 84 fi 83 #echo $iSecondsBehindMaster; 85 if [ "$iSecondsBehindMaster" == "NULL" ];then 86 fLog "local slave status NULL"; 87 exit 7; 88 fi 89 fLog "iSecondsBehindMaster=$iSecondsBehindMaster"; 84 90 iCounter=0; 85 while [ $iCounter -lt $iTimeoutSecs] && [ $iSecondsBehindMaster -gt "0" ];do91 while [ $iCounter -lt "$iTimeoutSecs" ] && [ $iSecondsBehindMaster -gt "0" ];do 86 92 let iCounter=iCounter+1; 87 93 eval `echo "SHOW SLAVE STATUS\G" | mysql -p$1 | grep Seconds_Behind_Master | awk '{printf"iSecondsBehindMaster=%s\n",$2}'`; … … 90 96 exit 8; 91 97 fi 98 if [ "$iSecondsBehindMaster" == "NULL" ];then 99 fLog "local slave status NULL"; 100 exit 9; 101 fi 92 102 #double the timeout for long catch-up 93 103 sleep 2; … … 95 105 if [ $iCounter -eq "$iTimeoutSecs" ];then 96 106 fLog "local slave catch-up timeout"; 97 exit 9;107 exit 10; 98 108 fi 99 109
