Mysql5.7 Multi-source replication, filtering replication after a period of time to increase the replication of a library implementation method

Source: Internet
Author: User
Tags db2

Multi-source replication If this is an entire instance-level replication, there is no scenario described below. If you are filtering replication on one or more of the primary instances, and after running for a while, how do you want to add a library to this source? Main 1:192.168.1.10 3306 DB1 DB2 Main 2:192.168.1.20 3306 db3 from: 192.168.1.30 3306 If the previous implementation is to filter replication, the replication is the db1 of the main 1 and the db3 of the main 2, has been running for some time. Now want to increase the DB2 on the main 1, how to achieve? The specific implementation method is as follows: 1. Use Mysqldump to export DB2 (record POS1) and import multiple sources from the library. 2. Stop the multi-source SQL thread from the library ( STOP SLAVE SQL_THREAD), and record the location of the sync to main 1 at this moment pos2. 3. Use Mysqlbinlog to apply changes from POS1 to Pos2 to the slave library. (Mysqlbinlog--start-position=pos1--stop-position=pos2-d DB2 Xxx.log | Mysql-u-p-h-P) 4. Online modification of multi-source filter conditions from the library (change REPLICATION filter replicate_wild_do_table = (' db1.% ', ' db2.% ', ' db3.% ');) 5. Synchronize the filters to the parameter file. Another idea is whether you can add a channel to the new library DB2 alone. That is, 2 libraries in the same instance use a different 2 channel.

Mysql5.7 Multi-source replication, filtering replication after a period of time to increase the replication of a library implementation method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.