bidirectional Mutual Master from step:
12 machines Add a cluster machine access to the account given replication slave permissions
mysql> grant replication Slave on * * to ' rep ' @ ' 172.16.1.% ' identified by ' 1234566 ';
22 Machine parameter Configuration
Log_bin =/data/3307/mysql-bin
Log-slave-update
Relay-log =/data/3307/relay-bin Turn on the trunk log
server_id = 1 Another set to 2
Auto_increment-offset = 1 Start value another set to 2
Auto_increment-increment = 2 Step
3 from the boot server
/etc/init.dmysqld restart
42 servers change from one master to another
Change MASTER to
Master_host = ' HOST ', #另一台机器的地址
Master_port = 3306, #另一台机器的端口
Master_user = ' rep ', #另一台机器上第一步分配的用户名
Master_password = ' 123456 ', #另一台机器上第一步分配的密码
Master_log_file = ' mysql-bin.000001 ', #另一台机器上执行得到的文件名
Master_log_pos = 192; #另一台机器上得到的偏移量
If the master-slave replication is based on Gtid, don't look for Binglog and Pos points
Master_auto_position=1; #加上这个参数就可以
How does MySQL achieve two-way mutual primary replication?