[ale] SAM Replication and primary keys

David Tomaschik david at systemoverlord.com
Tue Jan 31 20:25:25 EST 2012


On Tue, Jan 31, 2012 at 6:24 PM, Chris Fowler
<cfowler at outpostsentinel.com> wrote:
> I have googled this and I'm not having much luck finding what I thought
> was a good method.
>
> I thought at one time it was possible to configure MySQL 4 to increment
> primary keys as odd, even, or sequential.
>
> I have a master and a slave.  I want to promote the slave to master.
> Use two masters.  I then want to merge the data and go back to a master
> and slave system.  To do this I either have to write a script to convert
> keys in one DB to keys not used in the other or I have to configure
> MySQL to create keys in a way that will allow the merge to be easy.
>
> I'm thinking this might be a way to do it
>
> http://www.neocodesoftware.com/replication/
>
> I read another page where they were doing something odd with keys, but
> it had huge gaps in key usage.  I would like the merged data to be
> 1,2,3,4,..., N
>
> Suggestions?
>
> Chris

If you have N servers, set auto_increment_increment to N and
auto_increment_offset to a unique value per-server in the range
[1..N].  http://dev.mysql.com/doc/refman/5.0/en/replication-options-master.html

-- 
David Tomaschik
OpenPGP: 0x5DEA789B
http://systemoverlord.com
david at systemoverlord.com



More information about the Ale mailing list