aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/pacemaker/database/mysql.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/profile/pacemaker/database/mysql.pp')
-rw-r--r--manifests/profile/pacemaker/database/mysql.pp31
1 files changed, 28 insertions, 3 deletions
diff --git a/manifests/profile/pacemaker/database/mysql.pp b/manifests/profile/pacemaker/database/mysql.pp
index e5882e7..bc5e644 100644
--- a/manifests/profile/pacemaker/database/mysql.pp
+++ b/manifests/profile/pacemaker/database/mysql.pp
@@ -18,6 +18,10 @@
#
# === Parameters
#
+# [*bootstrap_node*]
+# (Optional) The hostname of the node responsible for bootstrapping tasks
+# Defaults to hiera('mysql_short_bootstrap_node_name')
+#
# [*bind_address*]
# (Optional) The address that the local mysql instance should bind to.
# Defaults to $::hostname
@@ -32,12 +36,18 @@
# for more details.
# Defaults to hiera('step')
#
+# [*pcs_tries*]
+# (Optional) The number of times pcs commands should be retried.
+# Defaults to hiera('pcs_tries', 20)
+#
class tripleo::profile::pacemaker::database::mysql (
+ $bootstrap_node = hiera('mysql_short_bootstrap_node_name'),
$bind_address = $::hostname,
$gmcast_listen_addr = hiera('mysql_bind_host'),
$step = hiera('step'),
+ $pcs_tries = hiera('pcs_tries', 20),
) {
- if $::hostname == downcase(hiera('bootstrap_nodeid')) {
+ if $::hostname == downcase($bootstrap_node) {
$pacemaker_master = true
} else {
$pacemaker_master = false
@@ -65,6 +75,7 @@ class tripleo::profile::pacemaker::database::mysql (
'default-storage-engine' => 'innodb',
'innodb_autoinc_lock_mode' => '2',
'innodb_locks_unsafe_for_binlog'=> '1',
+ 'innodb_file_per_table' => 'ON',
'query_cache_size' => '0',
'query_cache_type' => '0',
'bind-address' => $bind_address,
@@ -100,6 +111,7 @@ class tripleo::profile::pacemaker::database::mysql (
}
class { '::tripleo::profile::base::database::mysql':
+ bootstrap_node => $bootstrap_node,
manage_resources => false,
remove_default_accounts => $remove_default_accounts,
mysql_server_options => $mysqld_options,
@@ -112,6 +124,12 @@ class tripleo::profile::pacemaker::database::mysql (
}
if $step >= 2 {
+ pacemaker::property { 'galera-role-node-property':
+ property => 'galera-role',
+ value => true,
+ tries => $pcs_tries,
+ node => $::hostname,
+ }
if $pacemaker_master {
pacemaker::resource::ocf { 'galera' :
ocf_agent_name => 'heartbeat:galera',
@@ -119,7 +137,14 @@ class tripleo::profile::pacemaker::database::mysql (
master_params => '',
meta_params => "master-max=${galera_nodes_count} ordered=true",
resource_params => "additional_parameters='--open-files-limit=16384' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}'",
- require => Class['::mysql::server'],
+ tries => $pcs_tries,
+ location_rule => {
+ resource_discovery => 'exclusive',
+ score => 0,
+ expression => ['galera-role eq true'],
+ },
+ require => [Class['::mysql::server'],
+ Pacemaker::Property['galera-role-node-property']],
before => Exec['galera-ready'],
}
exec { 'galera-ready' :
@@ -155,7 +180,7 @@ class tripleo::profile::pacemaker::database::mysql (
# This step is to create a sysconfig clustercheck file with the root user and empty password
# on the first install only (because later on the clustercheck db user will be used)
# We are using exec and not file in order to not have duplicate definition errors in puppet
- # when we later set the the file to contain the clustercheck data
+ # when we later set the file to contain the clustercheck data
exec { 'create-root-sysconfig-clustercheck':
command => "/bin/echo 'MYSQL_USERNAME=root\nMYSQL_PASSWORD=\'\'\nMYSQL_HOST=localhost\n' > /etc/sysconfig/clustercheck",
unless => '/bin/test -e /etc/sysconfig/clustercheck && grep -q clustercheck /etc/sysconfig/clustercheck',