Fix issues with galera bootstraping.
First the service name can be taken from the class['Myslq'] so this has to be adjusted as well to take the mysql-bootstrap into consideration. Second, is a improvement. The pc.bootstrap=1 isn't required so the configuration is the same on all the nodes. Third I increase the default boot time of the galera because of the synchronization that can take some time. This must be applied with the code associated to GH-126 to work properly. Both should close GH-11
This commit is contained in:
parent
4a915cb17e
commit
38fe425b59
@ -58,13 +58,21 @@ class cloud::database::sql (
|
||||
|
||||
include 'xinetd'
|
||||
|
||||
$gcomm_definition = inline_template('<%= @galera_internal_ips.join(",") + "?pc.wait_prim=no" -%>')
|
||||
|
||||
if $::hostname == $galera_master_name {
|
||||
$mysql_service_name = 'mysql-bootstrap'
|
||||
} else {
|
||||
$mysql_service_name = 'mysql'
|
||||
}
|
||||
|
||||
# TODO(Gonéri): OS/values detection should be moved in a params.pp
|
||||
case $::osfamily {
|
||||
'RedHat': {
|
||||
class { 'mysql':
|
||||
server_package_name => 'MariaDB-Galera-server',
|
||||
client_package_name => 'MariaDB-client',
|
||||
service_name => 'mysql'
|
||||
service_name => $mysql_service_name,
|
||||
}
|
||||
# galera-23.2.7-1.rhel6.x86_64
|
||||
$wsrep_provider = '/usr/lib64/galera/libgalera_smm.so'
|
||||
@ -84,7 +92,7 @@ class cloud::database::sql (
|
||||
class { 'mysql':
|
||||
server_package_name => 'mariadb-galera-server',
|
||||
client_package_name => 'mariadb-client',
|
||||
service_name => 'mysql'
|
||||
service_name => $mysql_service_name,
|
||||
}
|
||||
$wsrep_provider = '/usr/lib/galera/libgalera_smm.so'
|
||||
}
|
||||
@ -112,24 +120,30 @@ class cloud::database::sql (
|
||||
before => Package['mysql-server'],
|
||||
}
|
||||
|
||||
# The startup time can be longer than the default 30s so we take
|
||||
# care of it there. Until this bug is not resolved
|
||||
# https://mariadb.atlassian.net/browse/MDEV-5540, we have to do it
|
||||
# the ugly way.
|
||||
file_line { 'debian_increase_mysql_startup_time':
|
||||
line => 'MYSQLD_STARTUP_TIMEOUT=120',
|
||||
path => '/etc/init.d/mysql',
|
||||
after => '^CONF=',
|
||||
require => Package['mysql-server'],
|
||||
notify => Service['mysqld'],
|
||||
}
|
||||
}
|
||||
|
||||
$gcomm_base = inline_template('<%= @galera_internal_ips.join(",") + "?pc.wait_prim=no" -%>')
|
||||
class { 'mysql::server':
|
||||
config_hash => {
|
||||
bind_address => $api_eth,
|
||||
root_password => $mysql_root_password,
|
||||
service_name => $mysql_service_name,
|
||||
},
|
||||
notify => Service['xinetd'],
|
||||
}
|
||||
|
||||
if $::hostname == $galera_master_name {
|
||||
|
||||
|
||||
class { 'mysql::server':
|
||||
config_hash => {
|
||||
bind_address => $api_eth,
|
||||
root_password => $mysql_root_password,
|
||||
service_name => 'mysql-bootstrap',
|
||||
},
|
||||
notify => Service['xinetd'],
|
||||
}
|
||||
|
||||
$gcomm_definition = "${gcomm_base}&pc.bootstrap=1"
|
||||
|
||||
# OpenStack DB
|
||||
class { 'keystone::db::mysql':
|
||||
dbname => 'keystone',
|
||||
@ -205,17 +219,6 @@ class cloud::database::sql (
|
||||
}
|
||||
|
||||
Database_user<<| |>>
|
||||
} else {
|
||||
$gcomm_definition = $gcomm_base
|
||||
|
||||
class { 'mysql::server':
|
||||
config_hash => {
|
||||
bind_address => $api_eth,
|
||||
root_password => $mysql_root_password,
|
||||
service_name => 'mysql',
|
||||
},
|
||||
notify => Service['xinetd'],
|
||||
}
|
||||
} # if $::hostname == $galera_master
|
||||
|
||||
# Haproxy http monitoring
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: mysql
|
||||
# Provides: mysql-bootstrap
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Should-Start: $network $named $time
|
||||
|
Loading…
x
Reference in New Issue
Block a user