ZRM for MySQL Server Amazon Machine Image (AMI) can be used to perform backup and recovery MySQL applications running on the Amazon EC2 cloud. The AMI has ZRM for MySQL Enterprise server installed along with all dependencies. The image also contains a pre-configured backup set that can be modified for backing up MySQL applications running in Amazon EC2 cloud. All functionality supported by ZRM Enterprise server is available in the AMI installation. Some features are licensed and license will be required to use these features.
This document discuss how to use the AMI, how to perform a backup of MySQL server running on EC2 and how to do complete recovery of MySQL server. For more information on any specific feature, please read other
To launch this Amazon Machine Image (AMI), you will need an Amazon AWS account and you'll need to subscribe to Amazon EC2. You will also need some tools to launch and manage AMIs. We suggest using Amazon AWS Management Console . You can also use the command line Amazon EC2 tools.
In this document, we provide examples using Amazon AWS Management Console.
Using AWS Management Console (Amazon account information is required), search for Zmanda Recovery Manager AMI. AMI can be found under Community AMIs (Click on EC2 Dashboard >> Launch Instances to see Community AMIs).
The ZRM AMI id isami-694fc300 (US East region). It runs RHEL 6 Linux distribution. Users can directly access the AMI by using Images >> AMIs from the options in left hand pane of AWS Management Console.
ZRM server AMI can use Amazon Elastic Block Store (EBS) volume to store ZRM backup images, catalog and configuration. This makes ZRM server data persistent across reboots and allows you to start ZRM server AMI only during backup window. You will need an EBS volume (appropriately sized) in the same availability zone as your EC2 instance. Now, you need to migrate ZRM catalog and configuration information to this EBS volume. A data migration script is available in Zmanda Network that performs this operation. The script also can reuse an existing volume that has ZRM data.
Please download the script and upload it to your S3 bucket.
ZRM AMI can be launched on Amazon EC2 using AWS Management Console.
Connection method | Protocol | From Port | To Port | Source IP |
---|---|---|---|---|
SSH | TCP | 22 | 22 | 0.0.0.0/0 |
HTTPS | TCP | 443 | 443 | 0.0.0.0/0 |
HTTP | TCP | 80 | 80 | 0.0.0.0/0 |
./migrate-to-ebs.pl <EBS volume id> <AWS account access key> <AWS account secret key>
You can automate this by creating a tinyurl to s3 bucket where the script is stored and running it at startup as
runurl <tinyurl url> <EBS volume id> <AWS account access key> <AWS account secret key>
By default, the ZRM AMI doesn't start ZRM services at boot time. The data migration script starts the ZRM services after setting up ZRM to use the data on the EBS volume. If you are not using the data migration script, then you can start zrm services at boot time by setting the user-data field while launching the AMI:
#! /bin/bash
/etc/init.d/zmc_zrm restart
If you are using AWS console, the user-data field is present in the show advanced options section.
ZRM server date and time : Please make sure that the system date and time on the ZRM server launched on EC2 is correct. Incorrect date and time will result in failure of EBS snapshots.
# yum install perl xinetd perl-Test-Mock-LWP perl-XML-Parser sudo
# /etc/init.d/xinetd start
# rpm -ivh MySQL-zrm-enterprise-client-3.5-1.noarch.rpm
Connection method | Protocol | From Port | To Port | Source IP |
---|---|---|---|---|
- | TCP | 25300 | 25300 | 0.0.0.0/0 |
MySQL | TCP | 3306 | 3306 | 0.0.0.0/0 |
mysql ALL=NOPASSWD:/bin/df,NOPASSWD:/usr/sbin/xfs_freeze,NOPASSWD:/usr/bin/mount,NOPASSWD:/usr/bin/umount
Login to Zmanda Management Console (default user and password is admin/admin) using a browser. The url will be https://<zrm server ec2 instance public DNS name>/ The ZRM server EC2 instance public DNS name will have following format - ec2-<string>-.compute-1.amazonaws.com The ZRM server EC2 instance public name can be found in AWS Management Console.
The ZRM web server certificate is a self signed certificate. This certificate has to be added as an exception.
For each MySQL server running in EC2 that needs to be backed up, a backup set has to be created. A default backup set demo-EBS-backup has been configured. This backup set can be edited or duplicated to create new backup sets.
Backup can be scheduled in Backup When page or performed immediately from Backup Summary page. Both full backup as well as incremental backups can be performed. Full backup is done using Amazon EBS snapshots. The full backup time taken depends on time to create EBS snapshots. The incremental backup is performed by copying incremental backups to ZRM server. This transfer is within Amazon cloud and should be quick. Full and incremental backups are hot backups. The Monitor page shows the backup phases when backup run is in progress.
Custom Reports page allow user to customize the backup reports across backup runs. The Backup runs can be exported as CSV file for analysis.
ZRM supports complete recovery of a MySQL server or recovery few database events. The database events in the incremental backups can be searched and selected for restoration using the Database event reports page.
Restoration process is similar to backup. Information for Restore what, where and how have to be provided. When restoration is being done to EC2 MySQL server, the Amazon Instance id of the restoration EC2 target must be provided in the Restore Where page. The Restore Where page also provides users to change where the MySQL data, logs Amazon EBS volumes should be mounted. On this page, you can specify the new disk device name which would be attached to the MySQL server instance after restoration from EBS snapshot is complete. The EC2 instance where the complete MySQL server is being restored to should have MySQL server processes running.
After completing Restore What, Where and How pages, the restore process can be started in Restore Restore page. The full backup and incremental backups can be restored to a point in time or to a specific database event. If only some database events are being restored from incremental backups (as can be done in '''Restore What''' page), the data is not restored from full backups and the EBS snapshot device maps are not used.