Changeset 1201
- Timestamp:
- 02/22/10 16:16:43 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/mysql-server/boot-cluster/boot-slave.sh
r1200 r1201 12 12 13 13 #Configuration section 14 cTimeoutSecs="300";14 iTimeoutSecs="300"; 15 15 cWarnEmail="supportgrp@unixservice.com"; 16 16 cSSHPort="22" … … 25 25 fi 26 26 27 #wait for master to come up. If does not come up after cTimeoutSecs send warning email, exit error.27 #wait for master to come up. If does not come up after iTimeoutSecs send warning email, exit error. 28 28 iCounter=0; 29 29 ping -c 1 $2 > /dev/null 2>&1; 30 while [ $? != 0 ] && [ $iCounter -lt $ cTimeoutSecs ];do30 while [ $? != 0 ] && [ $iCounter -lt $iTimeoutSecs ];do 31 31 let iCounter=iCounter+1; 32 32 ping -c 1 $2 > /dev/null 2>&1; 33 33 done 34 if [ $iCounter -eq "$ cTimeoutSecs" ];then34 if [ $iCounter -eq "$iTimeoutSecs" ];then 35 35 fLog "ping master timeout $iCounter"; 36 36 exit 1; … … 39 39 iCounter=0; 40 40 /usr/bin/ssh -p $cSSHPort $2 ps -ef | grep mysqld > /dev/null 2>&1; 41 while [ $? != 0 ] && [ $iCounter -lt $ cTimeoutSecs ];do41 while [ $? != 0 ] && [ $iCounter -lt $iTimeoutSecs ];do 42 42 let iCounter=iCounter+1; 43 43 /usr/bin/ssh -p $cSSHPort $2 ps -ef | grep mysqld > /dev/null 2>&1; 44 44 sleep 1; 45 45 done 46 if [ $iCounter -eq "$ cTimeoutSecs" ];then46 if [ $iCounter -eq "$iTimeoutSecs" ];then 47 47 fLog "remote mysqld timeout"; 48 48 exit 2; … … 75 75 fi 76 76 77 #check status. if slave did not catch up in max cTimeoutSecs send warning email, exit error.77 #check status. if slave did not catch up in max iTimeoutSecs send warning email, exit error. 78 78 eval `echo "SHOW SLAVE STATUS\G" | mysql -p$1 | grep Seconds_Behind_Master | awk '{printf"iSecondsBehindMaster=%s\n",$2}'`; 79 79 if [ $? != 0 ];then … … 83 83 #echo $iSecondsBehindMaster; 84 84 iCounter=0; 85 while [ $iCounter -lt $ cTimeoutSecs ] && [ $iSecondsBehindMaster -gt "0" ];do85 while [ $iCounter -lt $iTimeoutSecs ] && [ $iSecondsBehindMaster -gt "0" ];do 86 86 let iCounter=iCounter+1; 87 87 eval `echo "SHOW SLAVE STATUS\G" | mysql -p$1 | grep Seconds_Behind_Master | awk '{printf"iSecondsBehindMaster=%s\n",$2}'`; … … 93 93 sleep 2; 94 94 done 95 if [ $iCounter -eq "$ cTimeoutSecs" ];then95 if [ $iCounter -eq "$iTimeoutSecs" ];then 96 96 fLog "local slave catch-up timeout"; 97 97 exit 9;
