[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] SAM Replication and primary keys
- Subject: [ale] SAM Replication and primary keys
- From: david at systemoverlord.com (David Tomaschik)
- Date: Tue, 31 Jan 2012 20:25:25 -0500
- In-reply-to: <1328052242.6226.241.camel@compaq-desktop>
- References: <1328052242.6226.241.camel@compaq-desktop>
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