Set primary-primary replication: 1, set up a user with copy permission on both servers, 2, modify the configuration file: # on the primary server [Mysqld]server-id = 10log-bin = Mysql-binrelay-log = Relay-mysqlrelay-log-index = Relay-mysql.indexauto-increment-increment = 2Auto-increment-offset = 1# from the server [Mysqld]server-id = 20log-bin = Mysql-binrelay-log = Relay-mysqlrelay-log-index = Relay-mysql.indexauto-increment-increment = 2Auto-increment-offset = 23, if the two servers are newly established, and no other write operations, each server only need to record the current binary log files and the location of the event, as an additional server replication start location can server1|mysql> SHOW MASTER status\g****** 1. Row *************************** file:mysql-bin.000001 position:710 binlog_do_db:binlog_ignore_db:1 Row in Set (0.00 sec) server2|mysql> Show Master status\gmysql> show Master status\g*************************** 1. Row *************************** file:mysql-bin.000003 position:811 binlog_do_db:binlog_ignore_db:1 Row in Set (0.00 sec) 4, each server next specify to another server as its own master server can:server1|mysql> change master to ..., master_log_file= ' Mysql-bin.000003 ', master_log_pos=811 server2|mysql> change MASTER to ..., master_log_file= ' mysql-bin.000001 ', master_log_pos=710
From for notes (Wiz)
MySQL Master-master replication