Checking replication status

1,527 views
Skip to first unread message

Nicholas Knight

unread,
Jul 18, 2011, 8:20:13 AM7/18/11
to redi...@googlegroups.com

So, I see this on a Redis slave with the INFO command:

master_link_status:up
master_last_io_seconds_ago:1

Which is interesting, to be sure, but it's undocumented, and leaves me with some holes:

* It's not clear what "up" really means. Is it just that the socket hasn't received an error, or is there an actual heartbeat? If so, what is its interval?

* There's no equivalent of a "last io" on the master, so I can't compare them and alert if they start to diverge too much.

* Theoretically, couldn't last_io_seconds_ago be low or 0 with the slave still substantially behind the master, trying desperately to catch up?

So there doesn't seem to be a built-in sure-fire way to check the current state of replication. Ideally, I'd like a "transaction ID" type of value that gets updated with every data mutation, or failing that a timestamp of the last change on the master.

I'm considering just running a process on the master to update a key with a timestamp every second, which can then be checked on the slaves, which I guess would work, but seems pretty hackish, and relies on the health of an external process not inherently necessary for Redis to run.

Am I missing a better solution?

Thanks,
-NK

Dvir Volk

unread,
Jul 18, 2011, 8:39:54 AM7/18/11
to redi...@googlegroups.com
one way to make sure is using pub/sub and an external process, you publish incremental values to a "health" channel, and have clients subscribed to this channel on all children.
you not only know you are connected, but you are alerted exactly when this instance is in sync.



--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.


Reply all
Reply to author
Forward
0 new messages