On Thu, Jun 17, 2004 at 06:01:56PM +0300, Cemal Dalar <[EMAIL PROTECTED]> wrote:
> Actually. I am talking about a machine which is at office. And inside office
> we're connecting using ADSL which gets dynamic Ip  address. The slave
> server's IP address actully doesn't change. It doesn't have a real ip
> address only  the ADSL has. Simply saying we are using NAT.
> 
>     What I have in mind is to monitor the Read_Master_Log_Pos,
> Exec_master_log_pos with the master server and only allow small differences
> like ~10000. And also checking the other Slave_* values.

You're close here, I think. You've discovered that monitoring the
slave's running status isn't sufficient (but note that that doesn't
mean that you *shouldn't*, just that you need more), and that those
counters will keep incrementing. But you can't really tell how much
they will increment, and on the slave they will stop incrementing 
together if network connectivity is unavailable.

There's two ways to be sure that updates are going from the master to
the slave. The simplest is to watch that exec_master_log_pos keeps 
incrementing. This really only works reliably if it *is* always
incrementing, though; if you have large lulls where there are no
database writes, you won't see those changes. This is why I said that
you were close, above :-)

The other way to do it is to make sure there *are* writes; on the
master, create a table that contains a timestamp, and have a process
there keep updating the timestamp with the current time every, say, 30
seconds or a minute. On the slave, read that row and compare the current
time to the value in it; if they're more than, say, twice the update
period off, you know that updates aren't getting replicated.

Cheers,

  -Rich

-- 
Rich Lafferty --------------+-----------------------------------------------
 Ottawa, Ontario, Canada    |  Save the Pacific Northwest Tree Octopus!
 http://www.lafferty.ca/    |    http://zapatopi.net/treeoctopus.html
[EMAIL PROTECTED] -----------+-----------------------------------------------

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

Reply via email to