From 3f7acb22de0dff6a1e0deb6f6a9de70cdff869ac Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Tue, 3 Nov 2020 09:27:13 +0100 Subject: [PATCH] Change from master/slave to primary/secondary --- defaults/main.yml | 4 ++-- tasks/main.yml | 12 ++++++------ tasks/{master.yml => primary.yml} | 4 ++-- tasks/secondary.yml | 5 +++++ tasks/slave.yml | 5 ----- templates/automysqlbackup.conf | 4 ++-- templates/etc-mysql-my-cnf | 6 +++--- templates/etc-mysql-mysql-conf-d-mysqld.cnf | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) rename tasks/{master.yml => primary.yml} (71%) create mode 100644 tasks/secondary.yml delete mode 100644 tasks/slave.yml diff --git a/defaults/main.yml b/defaults/main.yml index a8156a8..cb9de4d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -34,8 +34,8 @@ mysql_tmp_table_size: 32M mysql_wait_timeout: 28800 mysql_repl_password: repl -mysql_repl_master: no -mysql_repl_slave: no +mysql_repl_primary: no +mysql_repl_secondary: no mysql_server_id: 0 mysqlbackup: diff --git a/tasks/main.yml b/tasks/main.yml index f0846ad..3692e05 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -85,13 +85,13 @@ notify: - Restart MySQL - - name: Import master - import_tasks: master.yml - when: mysql_repl_master + - name: Import primary + import_tasks: primary.yml + when: mysql_repl_primary - - name: Import slave - import_tasks: slave.yml - when: mysql_repl_slave + - name: Import secondary + import_tasks: secondary.yml + when: mysql_repl_secondary - name: Import backup import_tasks: backup.yml diff --git a/tasks/master.yml b/tasks/primary.yml similarity index 71% rename from tasks/master.yml rename to tasks/primary.yml index 0285527..0778444 100644 --- a/tasks/master.yml +++ b/tasks/primary.yml @@ -1,7 +1,7 @@ --- -# file: roles/mysql/tasks/master.yml +# file: roles/mysql/tasks/primary.yml -- name: Master | Define replication user and privileges +- name: Primary | Define replication user and privileges mysql_user: user: repl password: '{{mysql_repl_password}}' diff --git a/tasks/secondary.yml b/tasks/secondary.yml new file mode 100644 index 0000000..e27f779 --- /dev/null +++ b/tasks/secondary.yml @@ -0,0 +1,5 @@ +--- +# file: roles/mysql/tasks/secondary.yml + +- name: Secondary | Status + debug: msg="Currently nothing to do yet" diff --git a/tasks/slave.yml b/tasks/slave.yml deleted file mode 100644 index 8c9091f..0000000 --- a/tasks/slave.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# file: roles/mysql/tasks/slave.yml - -- name: Slave | Status - debug: msg="Currently nothing to do yet" diff --git a/templates/automysqlbackup.conf b/templates/automysqlbackup.conf index 39a8845..6adf3d1 100644 --- a/templates/automysqlbackup.conf +++ b/templates/automysqlbackup.conf @@ -144,9 +144,9 @@ CONFIG_mysql_dump_usessl='no' # http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html#option_mysqldump_master-data # --master-data[=value] # Use this option to dump a master replication server to produce a dump file that can be used to set up another -# server as a slave of the master. It causes the dump output to include a CHANGE MASTER TO statement that indicates +# server as a secondary of the primary. It causes the dump output to include a CHANGE MASTER TO statement that indicates # the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates -# from which the slave should start replicating after you load the dump file into the slave. +# from which the secondary should start replicating after you load the dump file into the secondary. # # If the option value is 2, the CHANGE MASTER TO statement is written as an SQL comment, and thus is informative only; # it has no effect when the dump file is reloaded. If the option value is 1, the statement is not written as a comment diff --git a/templates/etc-mysql-my-cnf b/templates/etc-mysql-my-cnf index 9283079..fd02ca9 100644 --- a/templates/etc-mysql-my-cnf +++ b/templates/etc-mysql-my-cnf @@ -97,16 +97,16 @@ long_query_time = 2 #log-queries-not-using-indexes # # 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 +# note: if you are setting up a replication secondary, see README.Debian about # other settings you may need to change. {% if mysql_server_id > 0 %} server-id = {{ mysql_server_id }} {% endif %} -{% if mysql_repl_master %} +{% if mysql_repl_primary %} log_bin = /var/log/mysql/mysql-bin.log sync_binlog = 1 {% endif %} -{% if mysql_repl_slave %} +{% if mysql_repl_secondary %} relay_log = /var/log/mysql/mysql-relay-bin.log read_only = yes {% endif %} diff --git a/templates/etc-mysql-mysql-conf-d-mysqld.cnf b/templates/etc-mysql-mysql-conf-d-mysqld.cnf index fedacde..3cf255c 100644 --- a/templates/etc-mysql-mysql-conf-d-mysqld.cnf +++ b/templates/etc-mysql-mysql-conf-d-mysqld.cnf @@ -91,7 +91,7 @@ slow_query_log_file = /var/log/mysql/slow.log {% endif %} # # 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 +# note: if you are setting up a replication secondary, see README.Debian about # other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log -- GitLab