Create a new MySQL replica from an existing replica

I use the default MySQL replica setup with a single master and one replica. Now I want to create a new replica so that I have one workshop and two replicas. To set up a new replica, I wanted to dump the existing replica MySQL, and not do it from the wizard.

In doing so, I think that I first need to stop the replica in order to get a consistent set of data:

mysql> STOP SLAVE;

Then I will find the replication coordinates so that I can start a new replica at the correct replication point:

mysql> SHOW SLAVE STATUS\G

Then I would take a dump by running this command on a replica:

bash> mysqldump --single-transaction --quick --lock-tables=false --insert-ignore --all-databases --master-data=2 | gzip > data-for-replica.sql.gz

and after completing the MySQL dump, I restarted the replica so that it would hang:

mysql> START SLAVE; 

My question is: since I use -single-transaction when doing a dump, can I parallelize these tasks:

  • , , MySQL.
  • .

- ? , ?

, , . , , , , , , . - ?

+4
1

mysqldump - , . , mysqldump , , , . , , , .

0

Source: https://habr.com/ru/post/1589413/


All Articles