Merge "Tweak MySQL logging configuration" into stable/8.0

This commit is contained in:
Jenkins 2016-01-25 18:40:42 +00:00 committed by Gerrit Code Review
commit 28ccf3772a
3 changed files with 28 additions and 2 deletions

View File

@ -63,6 +63,20 @@
# system at install time. NOTE: use_percona must be set to true for this to
# be used.
#
# [*binary_logs_enabled*]
# Set this value to true for enabling MySQL binary logging.
# Defaults to false
#
# [*binary_logs_period*]
# (optional) Set binary logrotation period in days.
# Defaults to 1
#
# [*binary_logs_maxsize*]
# (optional) If a write to the binary log causes the current log file
# size to exceed the value of this variable, the server rotates the
# binary logs (closes the current file and opens the next one). The
# minimum value is 4096 bytes. The maximum and default value is 512MB.
class galera (
$cluster_name = 'openstack',
$primary_controller = false,
@ -78,6 +92,9 @@ class galera (
$wsrep_sst_password = undef,
$use_percona = false,
$use_percona_packages = false,
$binary_logs_enabled = false,
$binary_logs_period = 1,
$binary_logs_maxsize = '512M',
) {
include galera::params

View File

@ -5,12 +5,15 @@ port=3307
max_connections=<%= @max_connections %>
default-storage-engine=innodb
binlog_format=ROW
log_bin=mysql-bin
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
default-storage-engine=innodb
expire_logs_days=10
<% if @binary_logs_enabled -%>
log_bin=mysql-bin
expire_logs_days=<%= @binary_logs_period %>
max_binlog_size=<%= @binary_logs_maxsize %>
<% end -%>
skip-external-locking
<% if @skip_name_resolve -%>

View File

@ -62,6 +62,12 @@ describe manifest do
provider = nil
end
it {
should contain_file('/etc/mysql/conf.d/wsrep.cnf').without(
:content => /.*log_bin=mysql-bin.*/,
)
}
it {
should contain_haproxy_backend_status('mysql').with(
:url => url,