Get the App
SLTechnology News&Howtos  ›  Database  › 

Multi-source replication method for building MySQL5.7

Shulou Source: shulou.com Published: 2022-06-01 18:28:13 11月01日 Update

Let's talk about the multi-source replication method of building MySQL5.7. The secret of the text is to be close to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading this article on how to build multi-source replication of MySQL5.7.

The experiment of MySQL5.7 multi-source replication

Environment:

Node1: 192.168.2.171 main Library 1

Node3: 192.168.2.170 main Library 2

Node2: 192.168.2.172 slave library for archiving

1. On node2, you need to configure replication to filter out the mysql library:

Replicate_wild_ignore_table=mysql.%

Replicate_wild_ignore_table=test.%

# 5.7 you can directly use stop slave; CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE = ('mysql.%','test.%'); start salve; to dynamically modify the replication filter library.

2. Import the backup mysqldump-uxx-pxx-Q-- single-transaction-- master-data=2 on node1 and node3 into node2.

3. Configure master-slave replication on node2

Execute on node2:

Change master to

Master_host='192.168.2.171'

Master_user='rpl'

Master_password='rpl'

Master_port=3306

Master_log_file='mysql-bin.000001'

Master_log_pos=4 for channel 'master-1'

Change master to

Master_host='192.168.2.170'

Master_user='rpl'

Master_password='rpl'

Master_port=3306

Master_log_file='mysql-bin.000001'

Master_log_pos=12 for channel 'master-2'

Start replication:

Start slave for channel 'master-1'

Start slave for channel 'master-2'

View status:

Show slave status for channel 'master-1'\ G

Show slave status for channel 'master-2'\ G

Stop:

Stop slave for channel 'master-1'

Stop slave for channel 'master-2'

Clear synchronization information and logs:

Reset slave for channel 'master-1'

Reset slave for channel 'master-2'

Swipe relaylog:

Flush relay logs for channel 'master-1'

Flush relay logs for channel 'master-2'

Is there anything you don't understand about the above multi-source replication method for building MySQL5.7? Or if you want to know more about it, you can continue to follow our industry information section.

Tags: Multi-source replication method method configuration following master-slave topic information content dynamic local backup secret text log more plate status environment article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Shulou Technology Shulou Tech Info Huawei