translate: backup zanata db directly to borg
As noted inline, a recent mysql client update has broken the "--all-databases" flag, at least for the client version and very old server version we use. Emperically, dumping individual databases still works with this client. Switch this to stream the db directly into borg. Ignore the old backups and remove the bup backup while we are here, since this is all borg now. Change-Id: I5fe762a003ce2c2ba4830367be87598f67f7e763
This commit is contained in:
parent
f9184ce323
commit
01990670c9
3
inventory/service/group_vars/translate.yaml
Normal file
3
inventory/service/group_vars/translate.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
borg_backup_excludes:
|
||||
# backed up via streaming
|
||||
- '/var/backups/mysql_backups*'
|
@ -130,6 +130,12 @@ class openstack_project::translate(
|
||||
require => Exec['register-zanata-projects'],
|
||||
}
|
||||
|
||||
# NOTE(ianw) 2021-02-05 : the --all-databases option to mysqldump
|
||||
# this sets up appears to not be dumping all databases since a
|
||||
# recent upgrade; see
|
||||
# https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1914695
|
||||
# This effectively makes this dump useless. Below we are streaming
|
||||
# the database directly into borg, which does still work.
|
||||
mysql_backup::backup_remote { 'translate':
|
||||
database_host => $mysql_host,
|
||||
database_user => $mysql_user,
|
||||
@ -138,9 +144,21 @@ class openstack_project::translate(
|
||||
require => Class['zanata'],
|
||||
}
|
||||
|
||||
include bup
|
||||
bup::site { 'ord.rax':
|
||||
backup_user => 'bup-translate',
|
||||
backup_server => 'backup01.ord.rax.ci.openstack.org',
|
||||
# Streaming backup of zanata db; see borg-backup role
|
||||
file { '/etc/borg-streams':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/etc/borg-streams/mysql':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
content => '/usr/bin/mysqldump --defaults-file=/root/.translate_db.cnf --ignore-table mysql.event --skip-extended-insert --single-transaction zanata',
|
||||
require => File['/etc/borg-streams'],
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user