Home  >  Q&A  >  body text

redis 如何判断主从延迟时间

现在使用的是redis 2.8.9 ,如何像mysql一样能监控到主从延迟的信息呢?

信息中有一段:

role:master
connected_slaves:2
slave0:ip=10.26.77.28,port=9102,state=online,offset=18096704050,lag=1
slave1:ip=10.52.50.18,port=9101,state=online,offset=18103346170,lag=1
master_repl_offset:18096710606

master_repl_offset
slave中是 slave_repl_offset

测试发现, 这两个值不能做为判断标准,slave的offset可能比master高. 求解?

大家讲道理大家讲道理2754 days ago1002

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-04-21 11:18:37

    lzDo you have an answer? I'm also looking for this method.

    reply
    0
  • 阿神

    阿神2017-04-21 11:18:37

    Is there any way?

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-21 11:18:37

    redis replication lag #2375
    https://github.com/antirez/re...

    Use info replication
    master_repl_offset - slave0:offset

    on the master

    reply
    0
  • Cancelreply