There are some differences between the two-master auto-growth conflicts in Mysql and the two-master-slave replication, because multiple masters can have write permissions on the server, so the problems that arise from the design to the auto-growth repetition problem (Multi-master auto-growth ID duplication) 1: First, we use the test table structure of A and B 2: Drop, perform the insert operation on the data table test (with an auto-increment ID) on table B, return the insert ID as 1 3: Stop B, and test (with an auto-increment ID) on Table) when the insert operation is executed, the returned insert ID is also 1 4: Then we start A, B at the same time, the primary key ID will be repeated solution: we only need to ensure that the self-growth data inserted on the two servers is different. For example, A queries the odd ID and B inserts the even ID. Of course, if there are many servers, you can define an algorithm, we can add parameters on a and B to achieve parity insertion. added the auto_increment_offset = 1 auto_increment_increment = 2 to the cnf. Values: 1, 3, 5, 7 ,... The values produced by the auto_increment field of B such as auto_increment_offset = 2 auto_increment_increment = 2 are: 2, 4, 6, 8 ,... You can see that your auto_increment field will never be repeated between different servers, so there is no problem with the Master-Master structure. Of course, you can also use 3, 4, or N servers. You only need to ensure auto_increment_increment = N and then set auto_increment_offset to the appropriate initial value, our MySQL can have dozens of Master servers at the same time, without repeated self-growth IDs.