Question about vzdump snapshot mode

bjdea1

New Member
Jul 25, 2009
2
0
1
Hi,
I've been reading up on how if doing an LVM snapshot of a partition with Mysql Databases on it you should first flush the databases and read lock them, do the snapshot and then unlock them again.

Are MySQL Databases properly backed up with vzdump using the "snapshot" method? I'd hate to be doing all these backups and find one day when I need to rebuild the system and restore these backups and find the Databases are corrupted.

Are you certain MySQL Databases are properly backed up using vzdump "snapshot" method? Does vzdump do a flush and readlock of MySQL Databases before taking the snapshot? And then unlock the databases again once its finished?
 
....
Does vzdump do a flush and readlock of MySQL Databases before taking the snapshot? And then unlock the databases again once its finished?

no. we plan to add the possibility to execute scripts before/after vzdump. in the meantime you have to do this manually (the vzdump gui just creates cron entries).
 
But in that case, is should be better to have a pre-snapshot script and post-snapshot script (to reduce the mysql lock time) instead of pre-vzdump and post-vzdump (because the dump could take a while, too long for locking mysql all this time, because the VE load will explode with too much mysql threads waiting the unlock).

Is it possible to do the snapshot manually and then run vzdump on our snapshot and not the one it will do ?
 
dcaillibaud,

I currently have a script that exports the mysql database via mysqldump and retains the 7 days worth of database data. This then gets rsynced by the proxmox host to one of the drives. Wehn you do a snapshot of a server that is running a mysql database, it is like having a backup of a machine that was powered off. Most of the time mysql can recover it's state / repair itself. Your best bet is to have your vm's that run mysql run a mysql dump script before it gets backed up. Or maybe try and have that VM do a lock/flush of the database via cron before the proxmox host does a backup via snapshot? The the VM do a lock/flush a minute before the snapshot / backup beggins?

- Garrett
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!