Each server inserts a "hearbeat" value into a replicated table.  The
server can see when the last heartbeat it received from its master
was.  If a heartbeat has not been received from the master in 3
minutes, and the master is available, then the replication status is
checked with "show slave status" to see what the status is.  If
replication is running and there are no errors, then I assume a long
operation is taking place (such as create index) and allow both
servers to remain up.  If either of the replication threads have
stopped because of an error, then the server recuses itself and a page
is automatically sent to me.

The biggest problem here is that the servers can't both recuse
themselves.  I have a number of healthchecks and each is assigned a
severity level.  The more severe the problems the less healthy the
server is said to be.  My script basically says "if I am more healthy
than my peer, then I will report up", "if I am equally healthy as my
peer, if my server_id is > 1 then I will report down", "if I am less
healthy than my peer, then I will report down"

That is the logic for writes.  For reads basically it is "if I am not
backlogged, then I am up"


On Tue, 10 Aug 2004 17:50:27 -0400, Mayuran Yogarajah
<[EMAIL PROTECTED]> wrote:
> Justin Swanhart wrote:
> 
> Im curious about this part.
> 
> >My healthcheck logic will make sure that server A doesn't appear to be
> >back up to the load balancer until it has caught up with server B, or
> >vice versa.
> >
> >
> >
> How do you accomplish this ? We have a similar situation here where a check
> is needed to be done to see if a slave has caught up to a master.  Are
> you checking
> the binary log names/positions or something more ?
> 
> thanks,
> Mayuran
>

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

Reply via email to