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

Update replication setup

parent de3f2e6c
No related branches found
No related tags found
1 merge request!4Develop
......@@ -50,7 +50,7 @@ drupal_settings:
## 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:
Starting from [here](https://dev.mysql.com/doc/refman/8.0/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
......@@ -62,14 +62,14 @@ Starting from [here](https://dev.mysql.com/doc/refman/5.7/en/replication-howto-m
```mysql
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
SHOW MASTER STATUS\G
```
**On the primary in a second shell:**
```shell
mysqldump --all-databases --master-data > dbdump.db
scp dbdump.db >[SECONDARY]:
mysqldump --all-databases --source-data > dbdump.db
scp dbdump.db [SECONDARY]:
```
**On the primary:**
......@@ -81,7 +81,7 @@ UNLOCK TABLES;
**With Ansible:**
```shell
apb mysqlsecondary --company=[COMPANY] --tags=changemaster --extra-vars="port=[PORT]" --extra-vars="binpos=[BINPOS]" --extra-vars="binlog=/var/log/mysql/[BINPOS]"
apb mysqlsecondary --company=[COMPANY] --limit=[SECONDARY] --tags=changemaster --extra-vars="port=[PORT]" --extra-vars="binpos=[BINPOS]" --extra-vars="binlog=/var/log/mysql/[BINFILENAME]"
```
**On the secondary:**
......@@ -91,6 +91,6 @@ mysql < dbdump.db
```
```mysql
START SLAVE;
SHOW SLAVE STATUS;
START REPLICA;
SHOW REPLICA STATUS\G
```
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