fuel-library/deployment/puppet/galera/templates/wsrep.cnf.erb
Andrii Petrenko 9660e49bdf Tweak MySQL logging configuration
For a galera replication we do not need binary logs, but we need binary logs in
case customer needs to perform MySQL backup. In this review we propose to limit
rotation period for 1 day, and set option to disable binary logging by default.

Change-Id: I001c87081a3b334eb8844abca60e468370ea5f24
Closes-Bug: #1533805
2016-01-15 10:27:42 -08:00

78 lines
2.4 KiB
Plaintext

[mysqld]
datadir=<%= @datadir %>
bind-address=<%= @node_address %>
port=3307
max_connections=<%= @max_connections %>
default-storage-engine=innodb
binlog_format=ROW
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
default-storage-engine=innodb
<% 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 -%>
skip-name-resolve
<% end -%>
<% if scope.lookupvar('memorysize_mb').to_i < 4000 -%>
performance_schema=off
<% end -%>
myisam_sort_buffer_size=<%= @myisam_sort_buffer_size %>
wait_timeout=<%= @wait_timeout %>
open_files_limit=<%= @open_files_limit %>
table_open_cache=<%= @table_open_cache %>
key_buffer_size=<%= @key_buffer_size %>M
max_allowed_packet=256M
query_cache_size=0
query_cache_type=0
innodb_file_format=Barracuda
innodb_file_per_table=1
<% if @mysql_buffer_pool_size -%>
innodb_buffer_pool_size=<%= @mysql_buffer_pool_size %>
<% end -%>
<% if @innodb_log_file_size_real != '0' -%>
innodb_log_file_size=<%= @innodb_log_file_size_real %>
<% end -%>
innodb_read_io_threads=8
innodb_write_io_threads=8
innodb_io_capacity=500
innodb_flush_log_at_trx_commit=2
innodb_flush_method=<%= @innodb_flush_method %>
innodb_doublewrite=0
innodb_autoinc_lock_mode=2
innodb_locks_unsafe_for_binlog=1
<% if @setup_multiple_gcomm -%>
wsrep_cluster_address="gcomm://<%= @node_addresses.collect {|ip| ip + ':' + @gcomm_port.to_s }.join ',' %>?pc.wait_prim=no"
<% else -%>
wsrep_cluster_address="gcomm://<%= @node_addresses.first %>:<%= @gcomm_port.to_s %>?pc.wait_prim=no"
<% end -%>
wsrep_provider=<%= @libgalera_prefix %>/libgalera_smm.so
wsrep_cluster_name="<%= @cluster_name -%>"
wsrep_slave_threads=<%= [[@processorcount.to_i*2, 4].max, 12].min %>
wsrep_sst_method=<%= @wsrep_sst_method %>
<% if @wsrep_sst_auth -%>
wsrep_sst_auth=<%= @mysql_user %>:<%= @mysql_password %>
<% end -%>
wsrep_node_address=<%= @node_address %>
wsrep_provider_options="gcache.size = <%= [256, @gcache_factor.to_i*64, 2048].sort[1] %>M"
wsrep_provider_options="gmcast.listen_addr = tcp://<%= @node_address %>:<%= @gcomm_port.to_s %>"
<% if @wsrep_sst_method =~ /xtrabackup/ -%>
[xtrabackup]
parallel=<%= [[@processorcount.to_i, 2].max, 6].min %>
[sst]
streamfmt=xbstream
transferfmt=socat
sockopt=,nodelay,sndbuf=1048576,rcvbuf=1048576
<% end -%>