Skip to end of metadata
Go to start of metadata

Part of the Joyent Percona SmartMachine is Joyent QuickBackup, a fast non-blocking MySQL backup service powered by Percona Xtrabackup on the back end. This service is pre-configured with the username and password but disabled by default. The only settings you need to configure are the minutehourday, and expiredays.

In this topic:

At a Glance

This topic shows you how to backup and restore a Percona MySQL database using Joyent Quickbackup.

Configuring Joyent Quickbackup

To configure the backup service, use the svccfg command to set the following values. By default, the service is set to backup every night at midnight

Property Description Accepted Values Default Value
quickbackup/username MySQL user for QuickBackup 16 characters qb-xxxxxxxx
quickbackup/password MySQL password for QuickBackup 41 characters xxxxxxxxxxx
quickbackup/minute Minute of the hour to backup 0-60 comma separated or 'all' 0
quickbackup/hour Hour of the day to backup 0-23 comma separated or 'all' 0
quickbackup/day Day of the week to backup sun-sat comma separated or 'all' all
quickbackup/expiredays Number of days to keep backups 1-255 or 'none' 3
quickbackup/databases Name of databases to backup dbname1,dbname2 or 'all' all
quickbackup/backupdir Name of directory to backup to /directory /backups
quickbackup/stream Streaming method for Quickbackup to use xbstream or tar xbstream

To see how properties are set for the service, use the svcprop command. For example:

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

To change a service property use the svccfg command. You specify which property you want to change and the value you want to set. For example, this command is setting the property value for the quickbackup/backupdir property:

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

When making a change to a Quickbackup property, you need to refresh the service for the change to take effect:

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

You can then verify that your change was set correctly with svcprop.

Backing up MySQL with Joyent QuickBackup (schedule)

By default, the service is set to backup every night at midnight. To set the service to perform a backup every 15 minutes of every hour Monday, Tuesday, Wednesday, Thursday, and Friday, you would use the following svccfg commands:

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

After setting the properties use the svcadm command to refresh and restart the service:

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

Each backup is saved in a file with a filename that points out when the backup was taken in /backups. The filename is in the format of %Y-%m-%d_%H-%M-%S-backup.tar.gz. The backup files contain all of the databases by default or each database you want to backup specified in the quickbackup/databases setting.

Quickbackup logs status messages to /var/log/mysql/quickbackup.log. If the backup completed successfully you will see a confirmation message in the log like the following:

At the end of every backup, QuickBackup will perform a clean up of old backup files and remove them if older than the value set for quickbackup/expiredays. It does this by checking the last modification time of the backup file.

Backing up MySQL with Joyent QuickBackup (manually)

To make a backup manually (not on a schedule) with QuickBackup you can call the script by its self.

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

After the backup it will rotate the backup files to quickbackup/expiredays set.

Restoring a MySQL Backup with Joyent QuickBackup

To restore a backup:

  1. Shut down the MySQL server:
    For Percona 13.1.0 and newer:

    For Versions prior to 13.1.0:

  2. Indicate which backup you want to restore by passing in the path to the backup file:
    For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

If successful, you will see a confirmation message that the restore completed successfully 

If you receive an error, you will need to check the QuickBackup log file at /var/log/mysql/quickbackup.log.

Once the restore is complete, re-enable MySQL:

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

At this point, everything is running from the restored backup.

Streaming Methods: tar and xbstream

In Quickbackup version 3.0 (and later), you can now select between two different streaming methods for performing a backup: tar and xbstream.

  • Tar is the previous method for Quickbackup, which is much slower but provides better compression. 
  • Xbstream is the new method, which is much faster but does not provide as good compression. 

The default is now xbstream, but the Joyent Public Cloud supports both.

You can configure the streaming method by setting the value of the quickbackup/stream property. To change it:

For Percona 13.1.0 and newer:

For Versions prior to 13.1.0:

When doing a Quickbackup restore, you now need to specify the streaming method used for the backup from which you are trying to restore.

Below is a comparison of the time it takes to perform a backup between 'tar' and 'xbstream' on a 10G dataset.

tar

xbstream

Labels:
svccfg svccfg Delete
percona percona Delete
svcprop svcprop Delete
quickbackup quickbackup Delete
xtrabackup xtrabackup Delete
svcadm svcadm Delete
mysql mysql Delete
backup backup Delete
restoring restoring Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.