On Mon, 2002-10-07 at 22:02, Jeremy Tinley wrote:
> The problem isn't so much with the failover.  It's with data integrity.
> Binlogs control replication.  You can place a failover master in between
> the master and slaves.  In the event of a master failure, you eliminate
> the loss of writes by directing them to the failover.  If you lose your
> failover, the binlogs can be completely different thus pointing the
> slaves to the master is useless.
> 
> The binlog position is the real problem.  Since binlogs are stored with
> their byte position as the indicator instead of a unique value passed on
> from the master, there's no easy way of finding the position you were
> just at.
> 
> Is is possible to write two binlogs?  One to the local disk, one to a
> network device?
> 

If you set up your failover to log-slave-updates, then this will
maintain a fairly up to date copy of your binlogs.  There is a risk
that if one update takes a very long time, then the master might 
get a long way ahead while the slave replicates this query, but 
generally as long as updates are short, this should provide a
reasonably secure remote copy of the contents of your binlog.

The next problem is that there is no way to synchronise the log
position on the failover with that on the master.  What you can do 
however, is periodically stop replication on the failover and 
snapshot the two log positions, eg:

        slave stop;
        show slave status;   # for Pm
        show master status;  # for Pf
        slave start;

The slave and master positions give you a reasonable chance of doing the
arithmetic required to resync all your slaves to the failover if the 
master fails.   Eg:

        Psf = Psm + (Pf - Pm)

where Psf is Position of slave relative to failover, 
Psm is Position of slave relative to master, Pm is a recorded master
position, and Pf is the corresponding slave position of the failover.

The arithmetic gets a bit hairy around rotations of the binlogs,
compounded by mysql sometimes inserting extra markers in the binlog
when rotations occur, and sometimes not. So, the more often snapshots
are made of the positions, the better.

Anyhow, there's another 2 cents...

==
Martin





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to