A scene demand
Multi-source replication version 5.7, target host 5.6.21
Some databases of 4 DB machines require a data summary for a linked table query
Two to build
1 export the corresponding destination library
Mysqldump-uuser-ppassword--master-data=2--single-transaction--databases--add-drop-database dbname >dbname.sql
2 Import the corresponding destination library to the multi-source replication machine
Note Version 5.6 requires that the first row be deleted, otherwise it cannot be imported.
Mysql-uuser-ppassword < Dbname.sql (parallel import, speed up)
3 Setting the appropriate ignore library (very important)
replicate-wild-ignore-table=test.%
Replicate-wild-ignore-table=mysql.%
replicate-wild-ignore-table=dbname.%
4 restarting a multi-source replication library
5 filtering postion and filename
Cat Dbname.sql|grep Change
6 opening the channel for change
Change MASTER to master_host= ', master_user= ', master_password= ', master_log_file= ', Master_log_pos=for CHANNEL ' Master-01 ';
Start slave for CHANNEL ' master-01 '
Change MASTER to Master_host= ", master_user=", master_password= ", master_log_file=", master_log_pos= for CHANNEL " Master-02 ';
Start slave for CHANNEL ' master-02 '
7 Show slave status for observation
8 problems that have been encountered
Scenario 1 Architecture Scenario MHA a master two-from-multi-source replication
The problem describes a multi-source replication connection that is primary, which is caused by the main hang-up, master-slave switching. Problems with multi-source replication
Solution The Master of the multi-source replication connection has been hung, so a change is required
MHA Switchover Failure condition
1 Since the new master is definitely regenerating Binlog, locate the new master's Binlog
2 analyze the specific SQL statements of the new main binlog, find them on the multi-source db, and then determine the at point for change
MHA the successful switching situation
1 refer to MySQL cascade replication to peer replication
Scenario 2 Multi-source DB error due to PT checksum master-Slave data consistency
The problem description PT check creates tables and corresponding DML operations in the specified library, and the multi-source DB ignores the test library, causing an error
The way the solution skips events is not feasible, because there are many, so the recovery is based on the most recent backup.
Summary for PT calibration Be sure to note the situation of the libraries ignored by the multi-source db, do not specify the ignored libraries
9 about multi-source replication synchronization Multiple primary IO is not catching up to the situation, not encountered
That's my understanding of multi-source replication.
MySQL Fourth article ~ about MySQL multi-source replication