Commit 2b1d5b16 authored by Vincent Pelletier's avatar Vincent Pelletier

stack/erp5: Make replicating mariadb write to their own binlogs.

This change has no effect on stand-alone setups (which is what is
automatically deployed).
On setups configured to replicate from another database, it allows them to
takeover the role of the primary server, which allows rebuilding a
redundant setup. On such setup, the cost of this option is the extra I/O
load of binlogs being written to (in addition to the relay log and
database), and the corresponding disk space use.
parent 41af80a5
Pipeline #16808 failed with stage
......@@ -42,7 +42,7 @@ md5sum = d32417746fcf671d4e86a70379815039
[template-my-cnf]
filename = my.cnf.in
md5sum = 7944ec58a2c6ee74a56219bacebfd145
md5sum = 1de449e8c0c4a85c5ce2b447785b7654
[template-mariadb-initial-setup]
filename = mariadb_initial_setup.sql.in
......
......@@ -56,6 +56,16 @@ log_bin = {{ log_bin }}
{% set binlog_expire_days = parameter_dict['binlog-expire-days'] -%}
{% if binlog_expire_days > 0 %}expire_logs_days = {{ binlog_expire_days }}{% endif %}
server_id = {{ parameter_dict['server-id'] }}
# Note: increases writes on replica (it writes to relay log and to database as
# usual, but then also to binlog), but with the advantage of allowing such node
# to switch role later, or to allow another replica to catch up with it if the
# primary is not available anymore. This also increases the disk usage on the
# replica, as the binlogs are stored as usual.
log_slave_updates = 1
# Note: as of at least mariadb 10.3.27, the relay log name is not based on the
# hostname, but still there is a line in mariadb_error.log on every start
# warning about this missing option. So provide it.
relay-log = mariadb-relay-bin
{% endif %}
# Some dangerous settings you may want to uncomment temporarily
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment