kudu NTP问题优化

问题:

kudu 进程运行一段时候后突然宕掉,查看日志出现clock error:

Sep 17, 8:32:31.135 PM FATAL tablet_server_main.cc:38 Check failed: _s.ok() Bad status: Service unavailable: Cannot initialize clock: Cannot initialize HybridClock. Clock synchronized but error was too high (11711000 us).

原因:

 kudu 对同步时间比较敏感,可使用

ntptime

查看服务器ntp时间,注意ntp同步时间和系统时间是不一样的,ntp需要重ntp服务器 同步获取时间,然后再和系统时间校准; 

Kudu要求NTP同步时钟的最大时钟错误(不要与估计的错误相混淆)不低于阈值 max_clock_sync_error_usec(10s);
NTP守护程序本身的同步状态并不反映本地时钟的同步状态,其驱动本地时钟的方式受到许多约束。


解决:

调整参数相关参数(默认10s,可改为20s)

--max_clock_sync_error_usec = 20000000

或者使用 chronyd 做时间同步;

Chrony是一个开源的自由软件,能保持系统时钟与时钟服务器(NTP)同步,因此让时间保持精确

 


参考:

https://github.com/apache/kudu/blob/master/docs/troubleshooting.adoc#ntp

https://github.com/apache/kudu/blob/master/docs/troubleshooting.adoc#monitoring-clock-synchronization-status-with-the-chrony-suite

原文地址:https://www.cnblogs.com/GO-NO-1/p/12626094.html