ZRM 2.1: Backing Up MySQL Partitioned Tables
ZRM 2.1: Backing Up MySQL Partitioned TablesMySQL 5.1 is generally available for production use. One of the key features of MySQL 5.1 is partitioning. Table partitioning can help in improving performance and usability. Tables can be partitioned based on range (column values in a given range), list (column values matching a set of values), hash (user defined hash based on column values) or key (predefined hash function based on column values). Each partition can have different data directory. Zmanda Recovery Manager for MySQL (ZRM) 2.1 release supports MySQL 5.1GA release. ZRM provides efficient backup and recovery of MySQL database. It can perform logical, raw as well as snapshot based backups. ZRM 2.1 supports storage snapshots (LVM and Solaris ZFS) as backup images and can be converted into regular backup image later. This how to shows how to install and configure ZRM 2.1 to perform backup and recovery of MySQL partitioned tables. This example uses MySQL 5.1.30 running on CentOS 4. The MySQL server has a myisamnetflix database that contains the MovieRatings partitioned table. * Install MySQL 5.1.30 on the server. Download server and client images from the MySQL downloads site. The following rpms should be downloaded and installed: MySQL-client-community-5.1.30-0.rhel4 * Follow the instructions to create default MySQL database and run MySQL server. * Check to see if the MySQL partitioning is enabled mysql> SHOW VARIABLES LIKE '%partition%'; +-------------------+-------+ * Create the table with key partitioning on MovieID column and populate the table with data. mysql> CREATE TABLE `MovieRatings` ( * Download ZRM 2.1 rpm from the Zmanda downloads page. * Create mysql-zrm.conf in the /etc/mysql-zrm/partition-test directory. partition-test is the backup set name. host="localhost" databases="myisamnetflix" password="boot12" user="root" compress=1 backup-mode=logical * Run a full backup of the backup set partition-set as mysql user. All ZRM operations should be performed as mysql user: $ mysql-zrm-scheduler --now --backup-set partition-test --backup-level 0 schedule:INFO: ZRM for MySQL Community Edition - version 2.1 * Use ZRM reporter to look at the status of the backups. $ /usr/bin/mysql-zrm-reporter --where backup-set=partition-test --show backup-status-info REPORT TYPE : backup-status-info
backup_set backup_date backup_level backup_status backup_type comment
-----------------------------------------------------------------------------------------------------------------------------
partition-test Tue 25 Nov 2008 06:11:19 0 Backup succeeded regular ----
PM PST
* Delete a few rows from the MovieID database to test the recovery from the backup image.
mysql> delete from MovieID where MovieTitle regexp 'Sherlock Holmes*'; Query OK, 28 rows affected (0.15 sec) * Run a report to identify the backup image to be restored and restore from the backup image. $ /usr/bin/mysql-zrm-reporter --where backup-set=partition-test --show restore-info REPORT TYPE : restore-info backup_set backup_date backup_level backup_directory backup_status comment ----------------------------------------------------------------------------------------------------------------------------------------------------- partition-test Tue 25 Nov 2008 06:11:19 0 /var/lib/mysql-zrm/partition-test/200811 Backup succeeded ---- PM PST 25181119 $ /usr/bin/mysql-zrm-restore --user=root --password=boot12 --source-directory=/var/lib/mysql-zrm/partition-test/20081125181119/ restore:INFO: ZRM for MySQL Community Edition - version 2.1 mysql> select count(*) from MovieID where MovieTitle regexp 'Sherlock Holmes*'; 28 rows in set (0.23 sec) The above example shows ZRM can be used to backup and recover partitioned tables in MySQL 5.1. A whitepaper on how to quickly configure ZRM 2.1 is available at http://www.zmanda.com/quick-mysql-backup.html.
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com







Recent comments
15 hours 23 min ago
16 hours 51 min ago
20 hours 26 min ago
23 hours 19 min ago
1 day 2 hours ago
1 day 2 hours ago
1 day 3 hours ago
1 day 4 hours ago
1 day 5 hours ago
1 day 5 hours ago