[ale] MySQL sync

Chuck Huber chuck at cehuber.org
Fri Feb 21 09:16:46 EST 2003


On Fri, Feb 21, 2003 at 09:07:58AM -0500, cfowler wrote:
> Chuck,
> 
> Does this make the whole server a slave or just the database?

The recipient database is the slave. But that doesn't mean you can't
perform operations on it.  For instance, you can still insert or delete
rows, create tables and such.  It's just that those operations are not
reflected in the master.  I use this to maintain an off-site copy of a
production database.  By policy, I consider it read-only.

I might also mention that there's a series of commands in the mysql
client that allow you to manipulate the replication process.  In this
architecture, it's the slave that's active, and pulls from the master.
The master is passive in this sense.  The additional functionalty that
you implemented inthe master causes it to log every transaction and
number it.  The slave then connects up and says "What's your latest
tran number?"  It compares that to the slave's last fetch transaction
number then says "Okay... gimmie everything since tran xxx". The master
then spews its guts to the slave.

Enjoy,
    - Chuck

-- 
"The purpose of encryption is to protect good people
from bad people, not to protect bad people from the government."
     Scott McNealy, CEO Sun Microsystems
"The best way for government to control people is to remain in
   a constant threat of war." ---Karl Marx
"They that can give up essential liberty to obtain a little temporary
   safety deserve neither liberty nor safety." -- Benjamin Franklin

 PGP signature




More information about the Ale mailing list