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
This commit is contained in:
sathlan 2014-01-31 01:53:30 -05:00
parent 4a915cb17e
commit 0389558b66
2 changed files with 17 additions and 19 deletions

View File

@ -49,7 +49,6 @@ class cloud::database::sql (
$neutron_db_password = $os_params::neutron_db_password, $neutron_db_password = $os_params::neutron_db_password,
$neutron_db_allowed_hosts = $os_params::neutron_db_allowed_hosts, $neutron_db_allowed_hosts = $os_params::neutron_db_allowed_hosts,
$mysql_root_password = $os_params::mysql_root_password, $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, $mysql_sys_maint_password = $os_params::mysql_sys_maint_password,
$galera_clustercheck_dbuser = $os_params::galera_clustercheck_dbuser, $galera_clustercheck_dbuser = $os_params::galera_clustercheck_dbuser,
$galera_clustercheck_dbpassword = $os_params::galera_clustercheck_dbuser, $galera_clustercheck_dbpassword = $os_params::galera_clustercheck_dbuser,
@ -87,6 +86,21 @@ class cloud::database::sql (
service_name => 'mysql' service_name => 'mysql'
} }
$wsrep_provider = '/usr/lib/galera/libgalera_smm.so' $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: { default: {
err "${::osfamily} not supported yet" err "${::osfamily} not supported yet"
@ -197,13 +211,6 @@ class cloud::database::sql (
privileges => ['all'] 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<<| |>> Database_user<<| |>>
} else { } else {
$gcomm_definition = $gcomm_base $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'", 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 # TODO/WARNING(Gonéri): template changes do not trigger configuration changes
mysql::server::config{'basic_config': mysql::server::config{'basic_config':
notify_service => true, notify_service => true,

View File

@ -3,12 +3,12 @@
# #
[client] [client]
host = localhost host = localhost
user = sys-maint user = debian-sys-maint
password = <%= @mysql_sys_maint_password %> password = <%= @mysql_sys_maint_password %>
socket = /var/run/mysqld/mysqld.sock socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade] [mysql_upgrade]
host = localhost host = localhost
user = sys-maint user = debian-sys-maint
password = <%= @mysql_sys_maint_password %> password = <%= @mysql_sys_maint_password %>
socket = /var/run/mysqld/mysqld.sock socket = /var/run/mysqld/mysqld.sock
basedir = /usr basedir = /usr