kolla-ansible/ansible/roles/mariadb/tasks/backup.yml
Mark Goddard 7f47ddf7f4 Use mariabackup for database backups
Currently, Xtrabackup is used for database backups. However, Xtrabackup
is not compatible with MariaDB 10.3. This change switches to use
mariabackup [1], which is available in the mariadb image.

The documented full and incremental restore procedures have been
modified to use mariabackup, following [2] and [3].

[1] https://mariadb.com/kb/en/library/mariabackup-overview/
[2] https://mariadb.com/kb/en/library/full-backup-and-restore-with-mariabackup/
[3] https://mariadb.com/kb/en/library/incremental-backup-and-restore-with-mariabackup/

Change-Id: Id52b9b1f7b013277e401b1f6b8aed34473d2b2c4
Closes-Bug: #1843043
Depends-On: https://review.opendev.org/691290
2019-11-01 18:44:10 +00:00

23 lines
780 B
YAML

---
- name: Taking {{ mariadb_backup_type }} database backup via Mariabackup
become: true
kolla_docker:
action: "start_container"
command: "bash -c 'sudo -E kolla_set_configs && /usr/local/bin/kolla_mariadb_backup.sh'"
common_options: "{{ docker_common_options }}"
detach: False
image: "{{ mariabackup_image_full }}"
name: "mariabackup"
restart_policy: no
remove_on_exit: True
environment:
BACKUP_TYPE: "{{ mariadb_backup_type }}"
volumes:
- "{{ node_config_directory }}/mariabackup/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "mariadb:/var/lib/mysql"
- "mariadb_backup:/backup"
- "kolla_logs:/var/log/kolla/"
when:
- inventory_hostname == mariadb_backup_host