Documentation ¶
Overview ¶
The `xtrabackup` plugin for SHIELD implements backup + restore functionality for the cf-mysql-release.
PLUGIN FEATURES ¶
This plugin implements functionality suitable for use with the following SHIELD Job components:
Target: yes Store: no
PLUGIN CONFIGURATION ¶
The endpoint configuration passed to this plugin is used to identify how to to connect to a MySQL instance co-located on the same machine.
Your endpoint JSON should look something like this:
{ "mysql_user": "username-for-mysql", "mysql_password": "password-for-above-user", "mysql_databases": <list_of_databases>, # OPTIONAL "mysql_datadir": "/var/lib/mysql", # OPTIONAL "mysql_xtrabackup": "/path/to/xtrabackup", # OPTIONAL "mysql_temp_targetdir": "/tmp/backups" # OPTIONAL "mysql_tar": "tar" # OPTIONAL }
Default Configuration
{ "mysql_tar" : "tar", "mysql_datadir" : "/var/lib/mysql", "mysql_xtrabackup" : "/var/vcap/packages/shield-mysql/bin/xtrabackup", "mysql_temp_targetdir": "/tmp/backups" }
mysql_databases: This option specifies the list of databases to back up. It accepts a string argument or path to a file that contains the list of databases to back up. The list is of the form "databasename1[.table_name1] databasename2[.table_name2]". If this option is not specified, all databases containing MyISAM and InnoDB tables will be backed up.
mysql_datadir: This option specifies MySQL's datadir.
mysql_xtrabackup: This option specifies the absolute path to the `xtrabackup` tool.
mysql_temp_targetdir: This option specifies the absolute path to a temporary directory used by the `xtrabackup` tool to backup the MySQL databases. It must be empty after each run of the plugin. It must be as big as the estimated MySQL data directory.
mysql_tar: This option specifies the absolute path to the `tar` tool.
BACKUP DETAILS ¶
The `xtrabackup` plugin backs up all data in the data directory. If the `databases` option is specified the plugin will only back up these databases.
RESTORE DETAILS ¶
To restore, the `xtrabackup` plugin moves back the backed up data files to the MySQL data directory. Before the restore operation, MySQL must be stopped and the MySQL data directory needs to be empty.
To complete the restore of a Galera cluster, all nodes must be stopped. The previously restored node must be rebooted in bootstrap mode. The other nodes will be added to the second time to the cluster..
DEPENDENCIES ¶
This plugin relies on the `xtrabackup` and `tar` utilities. Please ensure that they are present on the system that will be running the backups + restores for MySQL.