0

I have MySQL servers A, B, C, and D. Server A is the MySQL master who receives the write traffic, and my applications look at B + C for reads (current slaves). I have replication forwarding ALL database events from A --> B and then from B ---> C. Server B is a slave to A, but a "master" to C. There are about 14 databases being tracked in the bin-logs. So, I would like to setup replication to AWS Aurora (the future D server), but I only want to replicate ONE database to it, from server C. So my setup would ideally look like this:

A ----> B ----> C ----> D (aws aurora w/ 1 database)

How do I tell server C to become a replication master and only replicate ONE database to server D (aws aurora)? I hope this makes sense.

0

For the sake of this answer, you want to replicate database mydb

STEP 01 : Add Replication Filter to my.cnf on ServerD

[mysqld]
replication-do-db=mydb

STEP 02 : Stop Replication on ServerD

mysql> STOP SLAVE;
mysql> FLUSH TABLES;
mysql> FLUSH LOGS;
mysql> SET GLOBAL innodb_fast_shutdown = 0;

STEP 03 : Restart MySQL on ServerD

service mysql restart

STEP 04 : Start Replication on ServerD

mysql> START SLAVE;
mysql> SHOW SLAVE STATUS\G

After Step 04, the replication filter should appear in the SHOW SLAVE STATUS\G of ServerD

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.