From 0389558b66334565bd0f4549805e9698ab94fa02 Mon Sep 17 00:00:00 2001 From: sathlan Date: Fri, 31 Jan 2014 01:53:30 -0500 Subject: [PATCH] Debian.cnf must be in sync on all nodes. Fix regression. This caused "random" restart problem on Galera cluster. As soon as the nodes were synchronized, they wouldn't restart properly. This close GH-126 --- manifests/database/sql.pp | 32 +++++++++---------- .../database/{sys.cnf.erb => debian.cnf.erb} | 4 +-- 2 files changed, 17 insertions(+), 19 deletions(-) rename templates/database/{sys.cnf.erb => debian.cnf.erb} (84%) diff --git a/manifests/database/sql.pp b/manifests/database/sql.pp index 712e782e..0ac50d24 100644 --- a/manifests/database/sql.pp +++ b/manifests/database/sql.pp @@ -49,7 +49,6 @@ class cloud::database::sql ( $neutron_db_password = $os_params::neutron_db_password, $neutron_db_allowed_hosts = $os_params::neutron_db_allowed_hosts, $mysql_root_password = $os_params::mysql_root_password, - $mysql_sys_maint_user = $os_params::mysql_sys_maint_user, $mysql_sys_maint_password = $os_params::mysql_sys_maint_password, $galera_clustercheck_dbuser = $os_params::galera_clustercheck_dbuser, $galera_clustercheck_dbpassword = $os_params::galera_clustercheck_dbuser, @@ -87,6 +86,21 @@ class cloud::database::sql ( service_name => 'mysql' } $wsrep_provider = '/usr/lib/galera/libgalera_smm.so' + + database_user { 'debian-sys-maint@localhost': + ensure => 'present', + password_hash => mysql_password($mysql_sys_maint_password), + provider => 'mysql', + require => File['/root/.my.cnf'] + } + file{'/etc/mysql/sys.cnf': + ensure => file, + content => template('cloud/database/debian.cnf.erb'), + owner => 'root', + group => 'root', + mode => '0600', + require => Exec['clean-mysql-binlog'], + } } default: { err "${::osfamily} not supported yet" @@ -197,13 +211,6 @@ class cloud::database::sql ( privileges => ['all'] } - database_user { "${mysql_sys_maint_user}@localhost": - ensure => 'present', - password_hash => mysql_password($mysql_sys_maint_password), - provider => 'mysql', - require => File['/root/.my.cnf'] - } - Database_user<<| |>> } else { $gcomm_definition = $gcomm_base @@ -265,15 +272,6 @@ class cloud::database::sql ( onlyif => "stat ${::mysql::params::datadir}/ib_logfile0 && test `du -sh ${::mysql::params::datadir}/ib_logfile0 | cut -f1` != '256M'", } - file{'/etc/mysql/sys.cnf': - ensure => file, - content => template('cloud/database/sys.cnf.erb'), - owner => 'root', - group => 'root', - mode => '0600', - require => Exec['clean-mysql-binlog'], - } - # TODO/WARNING(Gonéri): template changes do not trigger configuration changes mysql::server::config{'basic_config': notify_service => true, diff --git a/templates/database/sys.cnf.erb b/templates/database/debian.cnf.erb similarity index 84% rename from templates/database/sys.cnf.erb rename to templates/database/debian.cnf.erb index ea94fbca..11d258aa 100644 --- a/templates/database/sys.cnf.erb +++ b/templates/database/debian.cnf.erb @@ -3,12 +3,12 @@ # [client] host = localhost -user = sys-maint +user = debian-sys-maint password = <%= @mysql_sys_maint_password %> socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost -user = sys-maint +user = debian-sys-maint password = <%= @mysql_sys_maint_password %> socket = /var/run/mysqld/mysqld.sock basedir = /usr