I'm looking for some help with a MySql Master-Master configuration issue.
I'm working on a server config that has been set up by another employee who is now unavailable to offer any assistance in this matter. This is my first experience of a setup such as this and after doing quite a bit of research all I've managed to find is conflicting (or missing!) information. As such I apologise if my question is stupid!
My issue is this:
While the replication is working between servers I have an issue with the way that Auto_Increment values are behaving.
I'm content that the AI Offset and Increment are correctly set:
-- Master1 --
auto_increment_increment = 2
auto_increment_offset = 1
-- Master2 --
auto_increment_increment = 2
auto_increment_offset = 2
And this currently works correctly (Master 1 has Odd AI_Numbers and Master 2 has Even AI_Numbers). Unfortunately the software that has been using this system only connects to Master 2 if Master 1 fails (which hasn't happened since boot 2 years ago). This means that for the part of the system I've now been tasked with updating we haven't seen an even AI_Number... ever!
Using:
SHOW TABLE STATUS FROM `Database` LIKE 'TableName';
I can see that the AI Value is 7765. However this is true for both tables - so even though Master2 has never had an insert run on it directly when the next one is run it will generate 7766 as the AI_Value. My question therefore is this:
Is this expected or should the table in Master2 have a value of 1 (thus generating 2 when an insert is run on it)? If this is expected then is there a way to keep the replication config but only increase the AI_Value of Master2 when an insert is run on it?
Thanks for your help!
Chris