pt-heartbeat 双端用法
pt-heartbeat 双端用法
# 源端:每秒写心跳(后台常驻)
pt-heartbeat --host=10.0.0.10 --user=monitor --password='***' \
--update --database=percona --interval=1 --daemonize
# 从库:量测延迟
pt-heartbeat --host=10.0.0.11 --user=monitor --password='***' \
--monitor --database=percona --interval=1| 为什么 | SHOW REPLICA STATUS 的延迟在无写入/大事务场景失真 |
|---|---|
| 仲裁 | 切换判定至少两路探测一致,防单点网络抖动误切 |
| 告警 | heartbeat 断流即告警(源端写入停止时也要能区分) |
心跳表建议独立小库(percona.heartbeat),避免与业务表混用。