From 2f07a2f1708f04173e496c46b1b21e24d38310e8 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Tue, 3 Nov 2020 15:32:44 +0100 Subject: [PATCH] Documentation for replication setup --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index f4e12a0..b9fc620 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,18 @@ drupal_settings: - cache* - access* ``` + +# Replcation + +- [Replication Configuration](https://dev.mysql.com/doc/refman/5.7/en/replication.html) +- [Replication SQL Statements](https://dev.mysql.com/doc/refman/5.7/en/sql-replication-statements.html) + +## Setting up a new replication + +Starting from [here](https://dev.mysql.com/doc/refman/5.7/en/replication-howto-masterstatus.html) there are basically these steps: + +- Create a DB dump: lock tables, remember bin log position, dump db (see [Choosing a Method for Data Snapshots](https://dev.mysql.com/doc/refman/5.7/en/replication-snapshot-method.html)) and copy to secondary host +- Unlock the tables again +- Configure secondary for new master with Ansible playbook `dans COMPANY mysqlsecondary --tags=changemaster --extra-vars="port=[PORT]" --extra-vars="binpos=[BINLOGPOS]"` +- On the secondary, start the MySQL server and turn off replication (`stop slave`) +- Import dump file and then start replication again (`start slave`) -- GitLab