Skip to content
Snippets Groups Projects
Commit 3f7acb22 authored by jurgenhaas's avatar jurgenhaas
Browse files

Change from master/slave to primary/secondary

parent 8eaa4f8e
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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
......
---
# 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}}'
......
---
# file: roles/mysql/tasks/slave.yml
# file: roles/mysql/tasks/secondary.yml
- name: Slave | Status
- name: Secondary | Status
debug: msg="Currently nothing to do yet"
......@@ -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
......
......@@ -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 %}
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment