Ad Widget

Collapse

Template for MySQL replication backlog?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Crazy Marty
    Member
    • Sep 2007
    • 75

    #1

    Template for MySQL replication backlog?

    I know I can use a UserParameter to get the replication delay, but it can either be "NULL" to indicate that replication is not working (which needs to fire a trigger), or a non-negative integer (which needs to fire a trigger if it exceeds a given number). How can I do this properly?
  • gryphius
    Member
    • Aug 2007
    • 30

    #2
    write a script that connects to the database, executes a "SHOW STATUS" to get the "Slave_running" field (http://dev.mysql.com/doc/refman/5.1/...variables.html ) and one that does the same with "SHOW SLAVE STATUS" (http://dev.mysql.com/doc/refman/5.0/...ve-status.html) to get "Seconds_Behind_Master"

    then configure those scripts as UserParameter.

    Comment

    • Crazy Marty
      Member
      • Sep 2007
      • 75

      #3
      Actually, my concern is how I should properly treat the "NULL" value, which indicates that replication is disabled. I saw a suggestion in another thread to replace that with a value of 99999, though I would use a much larger number (99999 seconds is only a little longer than 24 hours).

      Comment

      • gryphius
        Member
        • Aug 2007
        • 30

        #4
        using a large number in this case might be a bad idea. But maybe you could tell your wrapper script to return a negative number (-1) ?

        Comment

        Working...