Its been a while I wrote anything on MySQL and/or Database related things as I was on a long two month vacation and immediately had a job change.
Today I was playing a bit in trying to setup up the ZRM community backup on Cent OS 5 to have a incremental backup mechanism; to see how it works as I never had a chance to use it so far. In the process, I could not find a single source of document which explains the basic steps needed on first-hand setup (or my search did not yield the right docs), so thought of writing and noting it down myself for any future reference. More or less, the instructions should be same for any Linux favor.
Here are the steps:
- First install perl-DBI and perl-XML-Parser modules
123sudo yum install perl-DBI perl-XML-Parser
- Download and install ZRM package.
123sudo rpm -ivh MySQL-zrm-2.0-1.noarch.rpm123Password:123warning: MySQL-zrm-2.0-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 3c5d1c92123Preparing... <span class="rem">########################################### [100%]</span>1231:MySQL-zrm <span class="rem">########################################### [100%]</span>123Checking and Migrating old ZRM data
- Create user called
backup_user
identified bybackup_user
in MySQL123mysql> <span class="kwrd">GRANT</span> <span class="kwrd">ALL</span> <span class="kwrd">ON</span> *.* <span class="kwrd">TO</span> <span class="str">'backup_user'</span>@localhost IDENTIFIED <span class="kwrd">BY</span> <span class="str">'backup_user'</span>;123Query OK, 0 <span class="kwrd">rows</span> affected (0.00 sec)123mysql> flush <span class="kwrd">privileges</span>;123Query OK, 0 <span class="kwrd">rows</span> affected (0.00 sec)
- Add a new directory under /etc/mysql-zrm/ as ˜dailyrun™ and copy the mysql-zrm.conf to this directory
123sudo mkdir -<span class="kwrd">p</span> /etc/mysql-zrm/dailyrun123sudo cp /etc/mysql-zrm/mysql-zrm<span class="cls">.conf</span> /etc/mysql-zrm/dailyrun/
- Start editing the file /etc/mysql-zrm/dailyrun/mysql-zrm.conf and fill some of basic information and leave backup-level=1 and backup-mode=raw. The conf-file self-explains on every parameter, so it becomes easy for anyone to setup even for first time.
- Start testing the backup using mysql-zrm-scheduler by issuing:
123sudo mysql-zrm-scheduler --now --backup-set dailyrun
- Once tested, add it to the standard daily scheduler to backup at 1 AM:
123mysql-zrm-scheduler --add --interval daily --start 01:00 --backup-set dailyrun
I am not going further to explain on how to verify the backup and restore it back, even though they are straight forward by using the ZRM utilities provided by the Zmanda; and complete information can be found from here.
Thanks for trying ZRM.
For incremental backups, you will need to turn on binary logs on the MySQL server.
http://mysqlbackup.zmanda.com/index.php/Pre-Installation#Binary_Logs