Quantcast
Channel: MySQL Forums - Replication
Viewing all articles
Browse latest Browse all 1561

Mult-Master Replication in MySQL 5.1.51 (3 replies)

$
0
0
Hello,

I am in the process of testing multi-master (writting on both masters). Both masters are also acting as slave of each other to synchronize.
To deny auto-increment conflict i am storing even / odd values for auto increment.

problem is that even values (auto-increment) are storing by leaving upper limits i.e. with gaps.

Check through above data, when odd id's replicated to master2 i inserted even id's which lefts 2,4.
I am unable to understand why is that ? Can someone help please. Might be offeset or autoincrement variables are not set properly.

<code>
On Master 1:

auto_increment_increment = 2
auto_increment_offset = 1

select * from test;
+----+-------+
| id | name |
+----+-------+
| 1 | odd1 |
| 3 | odd2 |
| 5 | odd3 |


On Master 2:

auto_increment_increment = 2
auto_increment_offset = 2

select * from test;
+----+-------+
| id | name |
+----+-------+
| 1 | odd1 |
| 3 | odd2 |
| 5 | odd3 |
| 6 | even1 |
| 8 | even2 |
| 10 | even3 |

</code>

Viewing all articles
Browse latest Browse all 1561

Trending Articles