diff --git a/README.md b/README.md index f4e12a0a0e73b11389374e86cb5e4e4d947c1f73..b9fc620ee4c470764edea80481045aca42befbec 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`)