192.168.8.51 (M1)
192.168.8.50 (S1)
192.168.8.131 (M1)
192.168.8.132 (S1)
雙主雙從
M1 192.168.8.51
server-id=1
log-bin=mysql-bin
binlog-ignore-db=mysql
binlog-ignore-db=information_schema
binlog-do-db=testdb
binlog_format=STATEMENT
log-slave-updates
auto-increment-increment=2
auto-increment-offset=1
M2 192.168.8.131
server-id=3
log-bin=mysql-bin
binlog-ignore-db=mysql
binlog-ignore-db=information_schema
binlog-do-db=testdb
binlog_format=STATEMENT
log-slave-updates
auto-increment-increment=2
auto-increment-offset=2
192.168.8.50 S1(從)
server-id=2
relay-log=mysql-relay
192.168.8.132 S2(從)
server-id=4
relay-log=mysql-relay
## ================ 之前192.168.8.50和192.168.8.51搭建過主從========
stop slave
reset master
192.168.8.50 (S1複製M1)
change master to master_host='192.168.8.51',master_port=3306,master_user='qiao',master_password='12345678',master_log_file='mysql-bin.000001',master_log_pos=154;
192.168.8.132 (S2複製M2)
change master to master_host='192.168.8.131',master_port=3306,master_user='qiao',master_password='12345678',master_log_file='mysql-bin.000001',master_log_pos=154;
192.168.8.51 和 192.168.8.131 搭建主從(相互複製)
M1 192.168.8.51 (M1複製M2)
change master to master_host='192.168.8.131',master_port=3306,master_user='qiao',master_password='12345678',master_log_file='mysql-bin.000001',master_log_pos=154;
M2 192.168.8.131(M2複製M1)
change master to master_host='192.168.8.51',master_port=3306,master_user='qiao',master_password='12345678',master_log_file='mysql-bin.000001',master_log_pos=154;
本作品採用《CC 協議》,轉載必須註明作者和本文連結