diff --git a/manifests/init.pp b/manifests/init.pp index 61a2338..291d3bf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -39,6 +39,17 @@ # state transfer # Defaults to 4568 # +# [*wsrep_sst_method*] +# (optional) The method to use for state snapshot transfer +# between nodes +# Defaults to rsync +# xtrabackup, xtrabackup-v2, mysqldump, and skip options are also +# accepted +# Note that rsync 3.10 is incompatible with Percona XtraDB 5.5 +# currently (see launchpad bug #1315528). xtrabackup-v2 is the +# recommended solution when using Percona XtraDB on platforms such as +# Ubuntu trusty which provide rsync 3.10 +# # [*root_password*] # (optional) The mysql root password. # Defaults to 'test' @@ -76,6 +87,7 @@ $wsrep_group_comm_port = 4567, $wsrep_state_transfer_port = 4444, $wsrep_inc_state_transfer_port = 4568, + $wsrep_sst_method = 'rsync', $root_password = 'test', $override_options = {}, $vendor_type = 'percona', diff --git a/manifests/params.pp b/manifests/params.pp index a2301e1..1402aba 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -54,6 +54,25 @@ else { fail('This distribution is not supported by the puppet-galera module') } + + # add auth credentials for SST methods which need them: + # mysqldump, xtrabackup, and xtrabackup-v2 + if ($galera::wsrep_sst_method in [ 'skip', 'rsync' ]) { + $wsrep_sst_auth = undef + } + elsif ($galera::wsrep_sst_method in + [ 'mysqldump', + 'xtrabackup', + 'xtrabackup-v2' ]) + { + $wsrep_sst_auth = "root:${galera::root_password}" + } + else { + $wsrep_sst_auth = undef + warning("wsrep_sst_method of ${galera::wsrep_sst_method} not recognized") + } + + $default_options = { 'mysqld' => { 'bind-address' => $galera::bind_address, @@ -61,7 +80,8 @@ 'wsrep_provider' => $galera::params::libgalera_location, 'wsrep_cluster_address' => "gcomm://${server_csl}", 'wsrep_slave_threads' => '8', - 'wsrep_sst_method' => 'rsync', + 'wsrep_sst_method' => $galera::wsrep_sst_method, + 'wsrep_sst_auth' => $wsrep_sst_auth, 'binlog_format' => 'ROW', 'default_storage_engine' => 'InnoDB', 'innodb_locks_unsafe_for_binlog' => '1', diff --git a/spec/classes/galera_init_spec.rb b/spec/classes/galera_init_spec.rb index 74ac333..f0750ee 100644 --- a/spec/classes/galera_init_spec.rb +++ b/spec/classes/galera_init_spec.rb @@ -11,6 +11,7 @@ :wsrep_group_comm_port => 4567, :wsrep_state_transfer_port => 4444, :wsrep_inc_state_transfer_port => 4568, + :wsrep_sst_method => 'rsync', :root_password => 'test', :override_options => {}, :vendor_type => 'percona',