Merge pull request #856 from cfasnacht/ticket/6404-new_maxallowedpacket_parameter
add new backup dump parameter maxallowedpacket
This commit is contained in:
commit
ce892fb01f
7 changed files with 13 additions and 1 deletions
|
@ -509,6 +509,10 @@ Sets the server backup implementation. Valid values are:
|
|||
* `mysqlbackup`: Implements backups with MySQL Enterprise Backup from Oracle. Backup type: Physical. To use this type of backup, you'll need the `meb` package, which is available in RPM and TAR formats from Oracle. For Ubuntu, you can use [meb-deb](https://github.com/dveeden/meb-deb) to create a package from an official tarball.
|
||||
* `xtrabackup`: Implements backups with XtraBackup from Percona. Backup type: Physical.
|
||||
|
||||
##### `maxallowedpacket`
|
||||
|
||||
Define the maximum SQL statement size for the backup dump script. The default value is 1MB as this is the default Mysql Server value.
|
||||
|
||||
#### mysql::server::monitor
|
||||
|
||||
##### `mysql_monitor_username`
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
class mysql::backup::mysqlbackup (
|
||||
$backupuser = '',
|
||||
$backuppassword = '',
|
||||
$maxallowedpacket = '1M',
|
||||
$backupdir = '',
|
||||
$backupdirmode = '0700',
|
||||
$backupdirowner = 'root',
|
||||
|
|
|
@ -3,6 +3,7 @@ class mysql::backup::mysqldump (
|
|||
$backupuser = '',
|
||||
$backuppassword = '',
|
||||
$backupdir = '',
|
||||
$maxallowedpacket = '1M',
|
||||
$backupdirmode = '0700',
|
||||
$backupdirowner = 'root',
|
||||
$backupdirgroup = $mysql::params::root_group,
|
||||
|
|
|
@ -3,6 +3,7 @@ class mysql::backup::xtrabackup (
|
|||
$backupuser = '',
|
||||
$backuppassword = '',
|
||||
$backupdir = '',
|
||||
$maxallowedpacket = '1M',
|
||||
$backupmethod = 'mysqldump',
|
||||
$backupdirmode = '0700',
|
||||
$backupdirowner = 'root',
|
||||
|
|
|
@ -20,6 +20,7 @@ class mysql::server::backup (
|
|||
$postscript = false,
|
||||
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
|
||||
$provider = 'mysqldump',
|
||||
$maxallowedpacket = '1M',
|
||||
) {
|
||||
|
||||
if $prescript and $provider =~ /(mysqldump|mysqlbackup)/ {
|
||||
|
@ -47,6 +48,7 @@ class mysql::server::backup (
|
|||
'prescript' => $prescript,
|
||||
'postscript' => $postscript,
|
||||
'execpath' => $execpath,
|
||||
'maxallowedpacket' => $maxallowedpacket,
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -12,10 +12,12 @@ describe 'mysql::server::backup' do
|
|||
let(:default_params) {
|
||||
{ 'backupuser' => 'testuser',
|
||||
'backuppassword' => 'testpass',
|
||||
'maxallowedpacket' => '1M',
|
||||
'backupdir' => '/tmp',
|
||||
'backuprotate' => '25',
|
||||
'delete_before_dump' => true,
|
||||
'execpath' => '/usr/bin:/usr/sbin:/bin:/sbin:/opt/zimbra/bin',
|
||||
'maxallowedpacket' => '1M',
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
|
||||
USER=<%= @backupuser %>
|
||||
PASS='<%= @backuppassword %>'
|
||||
MAX_ALLOWED_PACKET=<%= @maxallowedpacket %>
|
||||
DIR=<%= @backupdir %>
|
||||
ROTATE=<%= [ Integer(@backuprotate) - 1, 0 ].max %>
|
||||
|
||||
# Create temporary mysql cnf file.
|
||||
TMPFILE=`mktemp /tmp/backup.XXXXXX` || exit 1
|
||||
echo -e "[client]\npassword=$PASS\nuser=$USER" > $TMPFILE
|
||||
echo -e "[client]\npassword=$PASS\nuser=$USER\nmax_allowed_packet=$MAX_ALLOWED_PACKET" > $TMPFILE
|
||||
|
||||
# Ensure backup directory exist.
|
||||
mkdir -p $DIR
|
||||
|
|
Loading…
Reference in a new issue