Hello,


I am no expert on playing around with IP addresses, but I would think this
a rather dodgy option. Wouldn't connections which you appear to have open
still get through, and connect to something unexpected? Dynamic DND would
probably work. I cannot guarantee access to the DNS system I (or rather, my
customers) are using, so this is not an option. I have therefore had to
implement failover at the application level.
If the connection is open on a machine which is then downed, then any further
reads/writes would fail, and you would need to reconnect.


The problem is more ensuring that things do *not* start up unexpectedly. If
the slave has suffered only a short outage, then comes back up again, it
will try and restart replication. But it must not do so because it is no
longer the master and its databases are now out of date.  I therefore have
the following features:
On failover, the surviving machine is told to stop replication from the
deceased, even if it returns.
Machines are not set to start slaving automatically at powerup. Instead the
application level checks to see if the two are in sync (by a special
one-entry table incremented every time the system cold starts) and only
starts the slaving process if both are at the same synch level.
When the deceased machine does return, the application orders it to drop
and reload the databases from the master. Once this has done, slaving can
resume.
Is your failover a manual or automatic process?, ie, if one DB goes down, do you need to run a script manually to failover, or does this happen transparently?

I assume that once the deceased machine returns and drops/reloads its databases, it sets the sync levels to be the same?

I use not circular but linear replication. A->B->C->... A is write master
for all tables, but B, C and D can be use as read-only copies for queries.
Since I have probably a 4:1 read to write ratio, this balances quite well.
My theory for our network here is to have something like:

[Reader A] [Reader B] [Reader C] [Reader D]

     ----------                            ----------
     |Master A|                            |Master B|
     |RO: fred|<<--------------------------|RW: fred|
     |RW: hank|-------------------------->>|RO: hank|
     ----------                            ----------

So you have two master databases with failover, and you have any number of reader databases which sync their DBs from the appropriate RW database (which is why floating IPs would be needed I would think)

If Master A and Master B are up to date with eachother, then should one fail, surely a 'SWITCH MASTER TO xxxx' command on each of the readers would let them continue to be up to date?

Can you see any(many?) problems with this?

As you can probably tell, this is my first foray into MySQL replication...

Many thanks,
Jonathan.


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to