TILT 模式:倾斜模式
void sentinelCheckTiltCondition(void) { // 计算当前时间 mstime_t now = mstime(); // 计算上次运行 sentinel 和当前时间的差 mstime_t delta = now - sentinel.previous_time; // 如果差为负数,或者大于 2 秒钟,那么进入 TILT 模式 if (delta < 0 || delta > SENTINEL_TILT_TRIGGER) { // 打开标记 sentinel.tilt = 1; // 记录进入 TILT 模式的开始时间 sentinel.tilt_start_time = mstime(); // 打印事件 sentinelEvent(REDIS_WARNING,"+tilt",NULL,"#tilt mode entered"); } // 更新最后一次 sentinel 运行时间 sentinel.previous_time = mstime(); }
讯享网
原因
However if the computer time changes in an unexpected way, or if the computer is very busy, or the process blocked for some reason, Sentinel may start to behave in an unexpected way.
如果计算机时间以意外的方式改变,或者计算机非常繁忙,或者进程由于某种原因被阻止,Sentinel可能会以意外的形式开始工作。
总结三点原因:
- 时间频繁变化( 如果差值小于0【表示调整到过去时间】,或者大于两秒钟【前拨两秒】,那就进入TITL模式,也就是sentinel可能有问题)
- 计算机繁忙
- 进程被阻止
排查过程
- 计算机繁忙(排查不是)×
讯享网#观察top命令 #数据库备份任务注释 #iotop,iostat观察io
- 进程被阻止 ×
(查看系统日志和redis及redis-sentinel日志,无观察到异常) - 时间频繁变化(重点)√
通过systemctl status chronyd 观察到ntp服务在运行 通过timedatectl 观察多次,发现有ntp同步开启,并同步状态有yes 通过chronyc sources -v 观察到有"*"状态的时间源,并且同步轮询记录
通过以上排查确定时间同步很可能有问题
验证时间同步问题
- 关闭时间同步,同时观察sentinel是否还有“tilt mode exited”
讯享网#关闭自动同步时间 timedatectl set-ntp no
发现再无“tilt mode exited”日志产生
- 重启自动时间同步
#开启自动同步时间 timedatectl set-ntp yes
发现“tilt mode exited”日志重新产生
重复几次测试,确定问题所在:ntp时间源有问题,造成redis-sentinel频繁进入TILT 模式
参考
https://github.com/redis/redis/issues/10547
https://blog.51cto.com/u_/
https://stackoverflow.com/questions//redis-sentinel-enter-mode-tilt-when-raid-check-running
https://www.coder.work/article/

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/89863.html