PDA

View Full Version : using ZRM on slave database



ananda
June 6th, 2007, 01:19 AM
Hi All,
Since doing either logical or RAW backup using ZRM requires read lock on tables, can we use ZRM to take backup on slave database as there would be on users connected to db and not have any impact on the application.

Also is there any drawback on using zrm on slave db, please let me know.

To do a 500GB logical backup using ZRM how much time would it take.

regards
anandkl

kkg
June 6th, 2007, 01:26 AM
Hi All,
Since doing either logical or RAW backup using ZRM requires read lock on tables, can we use ZRM to take backup on slave database as there would be on users connected to db and not have any impact on the application.

The fastest way is to use snapshots and in this case the read locks are taken only for a couple of seconds at the most. In all of the other cases, there will be some impact. The longest time the read locks are held will probably be for the logical backup.



Also is there any drawback on using zrm on slave db, please let me know.


No there are no drawbacks. Ensure that you set replication=1 in ZRM so that all of the replication related files are backed up.



To do a 500GB logical backup using ZRM how much time would it take.

There is a white paper dealing with performance in the Zmanda Network (http://network.zmanda.com). To access the white paper log in to, or register for free on, the Zmanda Network. The white paper can be found in the Documents -> white papers section.

--kkg

ananda
June 6th, 2007, 02:30 AM
Thank you kkg for the answers.

Also, is it possible that i take mysqldump of slave and restore this on a different machine and at regular intervals apply the bin-logs from slave on this new machine so that i can use this as alternate backup server in case some thing happens to my master/slave machine.

For this can i use zmanda software.

regards
anandkl

kkg
June 6th, 2007, 02:34 AM
Thank you kkg for the answers.

Also, is it possible that i take mysqldump of slave and restore this on a different machine and at regular intervals apply the bin-logs from slave on this new machine so that i can use this as alternate backup server in case some thing happens to my master/slave machine.

For this can i use zmanda software.

regards
anandkl

Yes this will work fine. You might see if you can use the post backup plugin to apply the bin-logs from the backup to a different machine.

--kkg

ananda
June 6th, 2007, 02:38 AM
can you please tell me what these "post-backup-plugin" are.

regards
anandkl

kkg
June 6th, 2007, 02:43 AM
can you please tell me what these "post-backup-plugin" are.

regards
anandkl


ZRM allows you to create your own post backup scripts and have ZRM invoke these at the end of backup.
Please refer to http://mysqlbackup.zmanda.com/index.php/Plugins.

--kkg

sjobeck
February 25th, 2010, 03:11 PM
Yes this will work fine. You might see if you can use the post backup plugin to apply the bin-logs from the backup to a different machine.

--kkg

Just out of curiosity, why not just replicate the master to a second replica? I'm sure you have a valid reason for doing it the way you want to do it, like being afraid of the master becoming corrupt & then replicating corrupting to both of your replicas, or something like that, right. But if youre doing that once already, why not just do it again, then you can flip one of those guys in to master mode if the master disappears. We're doing master-master replication here & it seems OK, it could IMHO be far more resilient in mySQL though.

It is a royal PITA to stop that, dump the one side, load it up again with fresh "master" data, then recreate the replication again, when something hiccups, but that's another topic in & of itself. I've wondered about doing this in postgresql ONLY for this reason, and if it is more resilient, then I'm tempted to move over there. But, again, a whole other topic.

Back to this though, isnt it cumbersome & error prone & slow to manually recreate what the software does on its own (ie: many replicas)?

I just wanted to think through this & maybe learn something while we're at it, is all.

Cheers.

Jason

zmanda_jacob
February 25th, 2010, 03:15 PM
Jason,

We recommend using replication and backing up replication slaves as opposed to masters whenever possible. The backups allow you to go back in time in the case that bad data is introduced and becomes replicated. If you enable "log-slave-updates" on your replication slave, then you have the ability using the ZRM to do both full and incremental backups off of a slave. This would be the ideal soution. I believe KK was simply continuing his answer within the thread. You are correct - replication would be better than using a post-backup plugin to apply bin-logs.

-Jacob