MySQL Forums
Forum List  »  Replication

make MySQL server master and slave at the same time
Posted by: Andrey Tovstik
Date: May 17, 2019 05:15AM

Hi, all

I have three MySQL instances:

MySQL_A - with DB_1
MySQL_B - replica of MySQL A
MySQL_C - with DB_2, DB_3

GTID is enabled on all MySQL servers

I want MySQL_A to be a replica of MySQL_C DB_2 only using GTID replication. I can easily setup DB2 replication based on binlog position. But when i try to create DB_2 replica using GTID, i get an error. Steps:

do mysqldump DB_2 from MySQL_C
import dump to MYSQL_A
change master on MySQL_A
mysql> CHANGE MASTER TO
-> MASTER_HOST='MySQL_C',
-> MASTER_USER='replication',
-> MASTER_PASSWORD='password',
-> MASTER_AUTO_POSITION=1;
mysql> CHANGE REPLICATION FILTER REPLICATE-DO-DB = ( DB_2 );
mysql> START SLAVE;

Next i receive an error:
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Cannot replicate because the master purged required binary logs. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. To find the missing transactions, see the master's error log or the manual for GTID_SUBTRACT.'

What additional steps i have to do?

Options: ReplyQuote


Subject
Views
Written By
Posted
make MySQL server master and slave at the same time
1499
May 17, 2019 05:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.