- Description
- Setup - The basics of getting started with xtrabackup
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module installs Percona xtrabackup / innobackupx and schedules automated backups of MySQL, MariaDB, Percona-Server and other MySQL derivitives.
- Percona repository
- xtrabackup / innobackupx installations
- cronjob for scheduling backups / retention period
Basic install with required paramaters and default settings.
class { ::xtrabackup:
backup_dir => '/mnt/backup/',
mysql_user => 'backup_user',
mysql_pass => 'backup_password'
}
All interactions with the xtrabackup module can be performed through the main ::xtrabackup class.
class { ::xtrabackup:
backup_dir => '/mnt/backup/',
mysql_user => 'backup_user',
mysql_pass => 'backup_password'
}
class { ::xtrabackup:
package_version => '2.3.4-1.el7',
enable_cron => false,
backup_dir => '/mnt/backup/',
mysql_user => 'backup_user',
mysql_pass => 'backup_password'
}
Schedule backup for weekly Friday night's at 11PM, set the backup retention to 30 days, and don't install the xtrabackup packages, and don't install the Percona repo:
class { ::xtrabackup:
backup_retention => '30',
cron_hour => '22',
cron_weekday => '5',
install_xtrabackup_bin => false,
manage_repo => false,
backup_dir => '/mnt/backup/',
mysql_user => 'backup_user',
mysql_pass => 'backup_password'
}
class { ::xtrabackup:
xtrabackup_options => '--parallel=2 --compress',
backup_dir => '/mnt/backup/',
mysql_user => 'backup_user',
mysql_pass => 'backup_password'
}
class { ::xtrabackup:
use_innobackupx => true,
innobackupx_options => '--slave-info',
backup_dir => '/mnt/backup/',
mysql_user => 'backup_user',
mysql_pass => 'backup_password'
}
- xtrabackup: Main class, includes all other classes.
- xtrabackup::repo: Installs and manages the percona repo.
- xtrabackup::install: Installs the packages and backup script.
- xtrabackup::cron: Schedules the cronjob.
Location to store the backup files (default: '') [REQUIRED]
User that should perform the backup (default: '') [REQUIRED]
Password that should perform the backup (default: '') [REQUIRED]
Which version of xtrabackup binaries to install (default: latest)
Should the module install the Percona xtrabackup packages? (default: true)
Should the module install the Percona repo? (default: true)
Should the module manage backup retention? (default: true)
Time in days the module should keep old backups around (default: 7)
Location to store the backup files (default: '') [REQUIRED]
Should the module use the innobackupx
command instead of xtrabackup
? (default: false)
Where should the backup shell script be installed? (default: '/usr/local/bin/')
User that should perform the backup (default: '') [REQUIRED]
Password that should perform the backup (default: '') [REQUIRED]
Should the module manage the cronjob to perform the backups? (default: true)
Hour(s) to schedule the backup (default: '1') # Cronjob defaults for daily at 1AM
Minute(s) to schedule the backup (default: '0')
Weekday(s) to schedule the backup (default: '*')
Month(s) to schedule the backup (default: '*')
Monthday(s) to schedule the backup (default: '*')
Extra options to pass to the xtrabackup command (default: '')
Extra options to pass to the innobackupx command (default: '')
Location where the shell script output should be logged (default: '/var/log/xtrabackup.log')
- RHEL/CentOS 6, 7
- Ubuntu 12.04, 14.04
- puppetlabs-stdlib >= 3.0.0
- puppetlabs-apt >= 2.0.0 (Only required for Ubuntu)
This module has only been tested on CentOS7 and Ubuntu 14.04 using Puppet Enterprise 2015.3
Please feel free to ask (or submit PRs) for feature requests, improvements, etc!