hey,

> - - shut down MySQL
> - - initialize LVM snapshot
> - - bring up MySQL again
> - - back up from the snapshot
> - - release snapshot when backup is complete

no need to shut the db down, just issue:

-----------
echo "About to lock tables"
time (echo "FLUSH TABLES WITH READ LOCK "|mysql)

echo "About to get master status"
time (echo "SHOW MASTER STATUS"|mysql > master-status-`date +'%Y-%m-%d'`)

echo "About to create snapshot"
time lvcreate --size 5G --snapshot --name snap --permission r
--verbose /dev/mysql/mysqldata

echo "About to unlock tables"
time (echo "UNLOCK TABLES"|mysql)
-----------

this locks the tables for read/write for a very short period and
records the master log positions at the time of the freeze, you can
now use this for a backup and/or use the backup to build replication
slaves and you'll know what log positions to give your slaves.

you also want to read:
http://www.mysqlperformanceblog.com/2006/08/21/using-lvm-for-mysql-backup-and-replication-setup/
http://mike.kruckenberg.com/archives/2006/05/mysql_backups_u.html

and some general LVM docs:
http://www.howtoforge.com/linux_lvm
http://www.howtoforge.com/linux_lvm_snapshots

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to