Skip to content

Commit

Permalink
enable mysqld replication on dbmaster
Browse files Browse the repository at this point in the history
  • Loading branch information
rodecker committed Nov 9, 2024
1 parent f97fc8a commit 0f28119
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions host_vars/dbmaster.infra.ring.nlnog.net
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ letsencrypt_certs:
- api6.ring.nlnog.net
- dbmaster.infra.ring.nlnog.net
mysqld_ssl: true
mysqld_serverid: 1
mysqld_replicate:
- ring
need_wsgi_py3: true

nftables:
Expand Down
16 changes: 11 additions & 5 deletions roles/mysql/templates/my.cnf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,18 @@ myisam_recover_options = BACKUP
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
{% if mysqld_serverid|default(None) %}
server-id = {{ mysqld_serverid }}
{% endif %}
{% if mysqld_replicate|default(None) %}
log_bin = /var/log/mysql/mysql-bin.log
{% for db in mysqld_replicate %}
binlog_do_db = {{ db }}
{% endfor %}
{% endif %}
#binlog_ignore_db = include_database_name
expire_logs_days = 10
max_binlog_size = 100M
#
# * InnoDB
#
Expand Down

0 comments on commit 0f28119

Please sign in to comment.