Checking xtrabackup has worked

As part of running backups I like a notification if one has failed. As far as I can find so far there are no return codes from the innobackex script that I could use so at the moment I am just checking the output for the line innobackupex-1.5.1: completed OK

/usr/bin/innobackupex-1.5.1 $BACKUP_DIR 2> /home/backup/logs/backup-$BACKUP_FILE.log
less /home/backup/logs/backup-$BACKUP_FILE.log | grep “innobackupex-1.5.1: completed OK”
if [ $? -ne 0 ] # string not found, ie. backup failed
then
echo “Backup failed”
mail -s “MySQL Production Backup failed” ????@????????.com
exit 1
else
echo “Backup Ok”
fi

Advertisements
Checking xtrabackup has worked

Building MySQL 5.6 from source on Mac

All version of MySQL from 5.5 upwards use cmake so this has to be installed first

port install cmake +gui

Then branch the code and build a tarball for MySQL Sandbox

bzr branch lp:mysql-server
cd mysql-server
mkdir b
cd b
cmake -DBUILD_CONFIG=mysql_release ..
make package

Building MySQL 5.6 from source on Mac

Checking Slaves are consistant

To check that the data is consistant between the masters and the slaves

Both of these commands are run on the master

./mk-table-checksum -u dba -p???????? –create-replicate –replicate mysql_health.checksums –ignore-databases mysql,mysql_health –empty-replicate-table –chunk-size=10M –nocheck-replication-filters localhost

Which will generate the checksum tables

./mk-table-checksum -u dba -p???????? –create-replicate –replicate mysql_health.checksums –ignore-databases mysql,mysql_health –empty-replicate-table –chunk-size=10M –nocheck-replication-filters –replicate-check 1 localhost

Will check that the tables are consistant

Checking Slaves are consistant