From 8bc1a7dd0528c2d652132eff0bf0bc7222ebc59a Mon Sep 17 00:00:00 2001 From: Chris Ricker Date: Fri, 2 May 2014 17:10:05 -0400 Subject: [PATCH 1/2] Add wsrep_sst_method Allow selection of wsrep_sst_method to support platforms such as Ubuntu trusty on which the default rsync SST method will not work with Percona XtraDB. --- manifests/init.pp | 12 ++++++++++++ manifests/params.pp | 18 +++++++++++++++++- spec/classes/galera_init_spec.rb | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) 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..84096f4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -54,6 +54,21 @@ 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 and may need authentication configured") + } + + $default_options = { 'mysqld' => { 'bind-address' => $galera::bind_address, @@ -61,7 +76,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', From abfe1a06f57153a7175935c22ea62ed80c7b8543 Mon Sep 17 00:00:00 2001 From: Chris Ricker Date: Sat, 3 May 2014 09:25:10 -0400 Subject: [PATCH 2/2] Formatting changes Clean up a couple of overly long lines. --- manifests/params.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 84096f4..1402aba 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -60,12 +60,16 @@ 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" + 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 and may need authentication configured") + warning("wsrep_sst_method of ${galera::wsrep_sst_method} not recognized") }