Perform backups using mydumper.
mydumper
(will not be installed)
-
mydumper_backup_install_path
: [default:/usr/local/bin
]: Install directory -
mydumper_backup_mydumper_path
: [default:/usr/local/bin
]: Path tomydumper
-
mydumper_backup_myloader_path
: [default:mydumper_backup_mydumper_path
]: Path tomyloader
-
mydumper_backup_all
: [optional, default:false
]: Whether or not to backup all databases. When true, disables databases options -
mydumper_backup_all_regex
: [optional]: A regular expression to match against database and table (only whenmydumper_backup_all
is true) -
mydumper_backup_backup_databases
: [default:[]
]: Backup declarations -
mydumper_backup_backup_databases.{n}.src
: [required]: Database name (from) -
mydumper_backup_backup_databases.{n}.dest
: [optional, defaultsrc
]: Directory name (to) -
mydumper_backup_restore_all
: [optional, default:mydumper_backup_all
]: Whether or not to restore all databases. When true, disables databases options -
mydumper_backup_restore_databases
: [default:mydumper_backup_backup_databases
]: Restore declarations -
mydumper_backup_restore_databases.{n}.src
: [required]: Database name (to) -
mydumper_backup_restore_databases.{n}.dest
: [optional, defaultsrc
]: Directory name (from) -
mydumper_backup_restore_databases.{n}.overwrite_tables
: [optional, defaultmydumper_backup_overwrite_tables
]: Drop any existing tables when restoring schemas -
mydumper_backup_backup_path
: [default:/tmp
]: Directory to backup to -
mydumper_backup_restore_path
: [default:mydumper_backup_backup_path
]: Directory to restore from -
mydumper_backup_backup_threads
: [optional, default:4
]: Number of threads to use for backup (e.g."{{ (ansible_processor_vcpus / 2) | round(0, 'ceil') }}"
) -
mydumper_backup_restore_threads
: [optional, default:mydumper_backup_backup_threads
]: Number of threads to use for restore -
mydumper_backup_host
: [optional, defaultlocalhost
]: The host to connect to -
mydumper_backup_user
: [optional]: User with privileges to run the dump -
mydumper_backup_password
: [optional]: User password -
mydumper_backup_verbose
: [optional, default:2
]: The verbosity of messages (e.g.0 = silent
,1 = errors
,2 = warnings
,3 = info
) -
mydumper_backup_compress
: [optional, default:false
]: Compress output files -
mydumper_backup_build_empty_files
: [optional, default:false
]: Build dump files even if no data available from table -
mydumper_backup_triggers
: [optional, default:false
]: Whether or not to dump triggers -
mydumper_backup_overwrite_tables
: [optional, default:false
]: Drop any existing tables when restoring schemas -
mydumper_backup_enable_binlog
: [optional, default:false
]: Log the data loading in the MySQL binary log if enabled
None
ansible-mydumper
(see)
- Backup all databases
- Restore all databases
---
- hosts: all
roles:
- oefenweb.mydumper-backup
vars:
mydumper_backup_all: true
mydumper_backup_overwrite_tables: true
- Backup all databases ignore
sakila
- Restore all databases
---
- hosts: all
roles:
- oefenweb.mydumper-backup
vars:
mydumper_backup_all: true
mydumper_backup_all_regex: '^(?!(sakila\.))'
- Backup database
sakila
to directorysakila
- Restore database
sakila
from directorysakila
---
- hosts: all
roles:
- oefenweb.mydumper-backup
vars:
mydumper_backup_backup_databases:
- src: sakila
mydumper_backup_overwrite_tables: true
- Backup database
sakila
to directoryalikas
- Restore database
sakila
from directoryalikas
---
- hosts: all
roles:
- oefenweb.mydumper-backup
vars:
mydumper_backup_backup_databases:
- src: sakila
dest: alikas
mydumper_backup_overwrite_tables: true
- Backup database
a
to directoryb
- Restore database
c
from directoryd
---
- hosts: all
roles:
- oefenweb.mydumper-backup
vars:
mydumper_backup_backup_databases:
- src: a
dest: b
mydumper_backup_restore_databases:
- src: c
dest: d
mydumper_backup_overwrite_tables: true
MIT
Mischa ter Smitten
Are welcome!