Get the App
SLTechnology News&Howtos  ›  Database  › 

The experiment of MySQL5.7 multi-source replication

Shulou Source: shulou.com Published: 2022-06-01 16:27:33 11月01日 Update

The experiment of MySQL5.7 multi-source replication

Node1: 192.168.2.171 master1

Node2: 192.168.2.172 slave

Node3: 192.168.2.170 master2

Execute on node2:

Change master to

Master_host='192.168.2.171'

Master_user='rpl'

Master_password='Abcd@1234'

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='Abcd@1234'

Master_port=3306

Master_log_file='mysql-bin.000001'

Master_log_pos=12 for channel 'master-2'

Start:

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'

Tags: Multi-source lab information log status synchronization Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Huawei Xiaomi Docker Apple