MySQL Forums
Forum List  »  NDB clusters

Crontab fail to start backup
Posted by: jongse park
Date: June 22, 2015 12:33AM

Hi,

I executed mysql cluster backup using crontab.
This is the error message:
-----------------------------------------------
[MgmtSrvr] ALERT -- Node 3: Backup request from 2 failed to start. Error: 1302
-----------------------------------------------

This is a backup script; backup.sh
-----------------------------------------------
#!/bin/sh

DATETIME=`date +%Y%m%d`
BASEDIR=/PRD_SQL/mysql_sql
BKDIR=/backup
BKCFG=${BKDIR}/config
BKLOG=${BKDIR}/log/mysql_full_cluster_${DATETIME}.log

find ${BKDIR}/log -name "*.log" -mtime +30 -exec rm {} \;


if [ -d ${BKDIR}/log ]
then
echo "Exist ${BKDIR}/log"
else
mkdir -p ${BKDIR}/log
fi

#################### MySQL config Backup ####################
echo " " > ${BKLOG}
echo "MySQL Cluster config backup start : `date +%H:%M:%S` " >> ${BKLOG}
cp /PRD_SQL/mysql_sql/my.cnf ${BKCFG}/my.cnf.${DATETIME}
cp /PRD_SQL/mysql_sql/config.ini ${BKCFG}/config.ini.${DATETIME}

#################### MySQL Cluster Backup ####################
echo " " >> ${BKLOG}
echo "MySQL Cluster data backup start : `date +%H:%M:%S` " >> ${BKLOG}
echo " " >> ${BKLOG}
echo "MySQL Binlog info" >> ${BKLOG}
echo "=================================================================" >> ${BKLOG}
cd $BASEDIR
${BASEDIR}/bin/mysql -uroot -pdlqehd11 -e show master status >> ${BKLOG}
echo "=================================================================" >> ${BKLOG}
echo " ">> ${BKLOG}

${BASEDIR}/bin/ndb_mgm -e show >> ${BKLOG}
echo " ">> ${BKLOG}
${BASEDIR}/bin/ndb_mgm -e "start backup ${DATETIME}2" >> ${BKLOG}

ssh mysql@xxx.xxx.xxx.66 "cd /backup/BACKUP;tar -czvf /backup/BACKUP/BACKUP-${DATETIME}2.tgz BACKUP-${DATETIME}2"
ssh mysql@xxx.xxx.xxx.66 "cd /backup/BACKUP;rm -rf BACKUP-${DATETIME}2"
ssh mysql@xxx.xxx.xxx.77 "cd /backup/BACKUP;tar -czvf /backup/BACKUP/BACKUP-${DATETIME}2.tgz BACKUP-${DATETIME}2"
ssh mysql@xxx.xxx.xxx.77 "cd /backup/BACKUP;rm -rf BACKUP-${DATETIME}2"

echo "MySQL Cluster backup end : `date +%H:%M:%S` " >> $BKLOG
---------------------------------------------------------------

The mysql cluster consist of 2 mgmd, 2 sqld, 2 ndbd.
1. When I execute the script. There is no error message.
./backup.sh
No error

2. ./bin/ndb_mgm -e "start bakcup 201505"
No error

3. When the backup is executed with crontab. There is the error message.
---------------------------------------------------------------------------
[MgmtSrvr] ALERT -- Node 3: Backup request from 2 failed to start. Error: 1302
---------------------------------------------------------------------------

Is there any bug for mysql cluster "Start Backup" with Crontab?


Please help me.

Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
Crontab fail to start backup
2013
June 22, 2015 12:33AM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.