Defined Type: bacula::client::mysql_bpipe

Defined in:
modules/bacula/manifests/client/mysql_bpipe.pp

Overview

Definition: bacula::client::mysql_bpipe

This definition creates a bpipe plugin at the host specifying it

Parameters:

$xtrabackup
    Required (true, false). Whether xtrabackup or mysqldump will be used
$xbstream_dir
    Required if xtrabackup is defined. Where xbstream will restore a backup.
    It should could make sense for this to be on the same physical partition
    as mysqld's datadir in order to minimize downtime
$per_database
    Required (true, false). Whether backups will be taken per database or not
$pigz_level
    pigz compression level. defaults to --fast (-1)
$is_master
    Whether the host to be backed-up has the binarly logs enabled in which
    case, --master-data=2 is passed to store the host binary location
    Defaults to false
$is_slave
    Whether the host to be backed-up is a slave in which case --dump-slave=2
    is passed to mysqldump and --slave-info --safe-slave-backup to xtrabackup
    Defaults to false
$mysqldump_innodb_only
    Whether the database is comprised of innodb only tables so it is safe to
    use --single-transaction. This defaults to false to err on the side of
    caution
$password_file
    A simple my.cnf style file containing the credentials for a valid
    account to the database that can be used by mysql and mysqldump
$local_dump_dir
    A simple my.cnf style file containing the credentials for a valid
    account to the database that can be used by mysql and mysqldump
$mysql_binary
    Path to mysql binary if you feel like overriding the default of
    /usr/bin/mysql
$mysqldump_binary
    Path to mysqldump binary if you feel like overriding the default of
    /usr/bin/mysqldump

Actions:

Will create a bpipe plugin for bacula

Requires:

bacula::client

Sample Usage:

bacula::client::mysql_bpipe { 'mybpipe':
    per_database            => false,
    xtrabackup              => true,
    xbstream_dir            => '/var/tmp/xbstream',
    mysqldump_innodb_only   => false,
}

Parameters:

  • per_database (Any)
  • xtrabackup (Any)
  • xbstream_dir (Any) (defaults to: '/var/tmp/xbstream')
  • pigz_level (Any) (defaults to: 'fast')
  • is_master (Any) (defaults to: false)
  • is_slave (Any) (defaults to: false)
  • mysqldump_innodb_only (Any) (defaults to: false)
  • password_file (Any) (defaults to: undef)
  • local_dump_dir (Any) (defaults to: undef)
  • mysql_binary (Any) (defaults to: '/usr/bin/mysql')
  • mysqldump_binary (Any) (defaults to: '/usr/bin/mysqldump')


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'modules/bacula/manifests/client/mysql_bpipe.pp', line 55

define bacula::client::mysql_bpipe(
                $per_database,
                $xtrabackup,
                $xbstream_dir='/var/tmp/xbstream',
                $pigz_level='fast',
                $is_master=false,
                $is_slave=false,
                $mysqldump_innodb_only=false,
                $password_file=undef,
                $local_dump_dir=undef,
                $mysql_binary='/usr/bin/mysql',
                $mysqldump_binary='/usr/bin/mysqldump',
                ) {
    file { "/etc/bacula/scripts/${name}":
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0550',
        content => template('bacula/bpipe-mysql-db.erb'),
        require => Class['bacula::client'],
    }

    if $xtrabackup {
        if ! defined(Package['percona-xtrabackup']) {
            package { 'percona-xtrabackup':
                ensure  => installed,
            }
        }

        file { $xbstream_dir:
            ensure => directory,
            owner  => 'root',
            group  => 'root',
            mode   => '0440',
        }
    }
}