You currently have a server instance running in a cloud infrastructure (e.g. Amazon EC2 regions or Rackspace Cloud) and you want to save a backup in a different cloud in order to create redundant backups and avoid a single point of failure. For example, you might have a MySQL database server running on EC2 and you want to save a dump file of the MySQL database in Rackspace's Cloud Files (cloud storage), or vice-versa.
You can use the DB MySQL mysqldump backup - 11H2 script to save a MySQL dump file to the cloud storage location of your choice. An Alpha version of the script is currently available in the MultiCloud Marketplace. You can use the script to save a dump file to an Amazon S3 bucket or a Rackspace Cloud Files container.
By default, the published version of the script is configured for the most common use case for the script where a backup will be stored in the same cloud infrastructure as where the cloud instance is currently running. (i.e. If you run the script on an EC2 instance, it will create a backup in an S3 bucket; if you run the script on a Rackspace instance, it will create a backup in a Cloud Files container.
However, you can make a couple minor modifications to the script so that you can use it to create backups in a different cloud than where your instance is currently running.
Note: The script is currently Alpha and is part of the 11H2 compatibility release. But, you should be able to run the script with 11H1 ServerTemplates as long as you run the RB Install Rightscale tools - 11H2 script before running the script.
- Import the following scripts from the MultiCloud Marketplace. (Publisher: RightScale) (Note: They currently have alpha suffixes.)
- DB MySQL mysqldump backup - 11H2.a1
- RB Install Rightscale tools - 11H2.a1
- Before you can run the DB MySQL mysqldump backup script on an instance, you must first run the RB Install Rightscale tools script because of script dependencies.
- Run the RB Install Rightscale tools script on the running MySQL database server.
- Clone and rename the DB MySQL mysqldump backup script. (Optional: You may want to commit the script before you make any modifications so that rev1 will be equivalent to the original version of the script.)
- Go to the Script tab and remove the 'RS_' prefix from the following line of code, which will create a user-configurable input.
- Click Identify. You should now see CLOUD_PROVIDER in the list of configurable inputs.
- Add a tooltip description for the new input and create a dropdown with 'ec2' and 'rackspace' as selectable text values.
- Click Save.
- Commit the script.
- Run the cloned script as an 'Any' script on a running instance. You will need to modify the following inputs to specify the appropriate information to store the dump file in the cloud storage location of your choice. Use the tooltip for help.
CLOUD_PROVIDER - Select the cloud infrastructure where the backup will be saved.
DB_MYSQLDUMP_BUCKET - The cloud storage location where the MySQL dump file will be saved.
- ec2: Enter the S3 bucket name
- rackspace: Enter the Cloud Files container name
DB_MYSQLDUMP_PREFIX - The prefix that will be used to name the MySQL dump file. (e.g. myprefix) The created dump file will also have a timestamp in the namespace. (e.g. myprefix-201104161345.gz)
STORAGE_ACCOUNT_ID - In order to write the dump file to the specified cloud storage location, you will need to provide authentication credentials.
- ec2: Cred:AWS_ACCESS_KEY_ID
- rackspace: Enter your Rackspace login Username.
STORAGE_ACCOUNT_SECRET - In order to write the dump file to the specified cloud storage location, you will need to provide authentication credentials.
- ec2: Cred:AWS_SECRET_ACCESS_KEY
- rackspace: Enter your Rackspace account API Key.
- Once the script has been successfully completed, check your cloud storage location for the dump file that you just created.