| 正常 | 有写入时逐步收敛到 0-1 秒 |
|---|---|
| 失真场景 | 无写入时恒 0;大事务执行中不动;源从时钟漂移 |
| 更可靠 | pt-heartbeat 写心跳表实测延迟 |
心跳观测(推荐)
心跳观测(推荐)
# 源端周期写心跳
pt-heartbeat --host=10.0.0.10 --user=monitor --password='***' \
--update --database=heartbeat --interval=1
# 从库端读取真实延迟
pt-heartbeat --host=10.0.0.11 --user=monitor --password='***' \
--monitor --database=heartbeat只看 Seconds_Behind_Source=0 不代表复制健康:IO 线程可能已断而 relay 刚被消化完。