Merge "galera: set wait_prim to true and bootstrap master node"

This commit is contained in:
Vladimir Kuklin 2012-11-27 18:26:22 +04:00 committed by Gerrit Code Review
commit 875872b9f4
2 changed files with 16 additions and 1 deletions

View File

@ -228,4 +228,16 @@ class galera($cluster_name, $master_ip = false, $node_address = $ipaddress_eth0,
tries => 6,
}
if ! $master_ip
{
exec { "bootstrap-galera" :
require => [Service['mysql-galera']],
subscribe => [Service['mysql-galera']],
before => [Exec['wait-for-synced-state']],
logoutput => true,
command => "/usr/bin/mysql -Nbe \"SET GLOBAL wsrep_provider_options='pc.bootstrap=1'\"",
}
}
}

View File

@ -44,12 +44,15 @@ wsrep_provider=<%= libgalera_prefix %>/galera/libgalera_smm.so
# Provider specific configuration options
# See http://www.codership.com/wiki/doku.php?id=faq
wsrep_provider_options="pc.ignore_sb = no"
# Logical cluster name. Should be the same for all nodes.
wsrep_cluster_name="<%= cluster_name -%>"
<% if setup_multiple_gcomm -%>
wsrep_cluster_address="gcomm://<%= @node_addresses.collect {|ip| ip + ':' + 4567 }.join ',' %>"
wsrep_cluster_address="gcomm://<%= @node_addresses.collect {|ip| ip + ':' + 4567 }.join ',' %>?pc.wait_prim=yes"
<% else -%>
<% if master_ip -%>
wsrep_cluster_address="gcomm://<%= master_ip %>:4567"