chronyd是用于同步系统时钟的守护进程。当将chrony指定为与Windows NTP服务器同步并使用默认配置文件(/etc/chrony.conf)时,服务器将显示为“不可用”。输出类似于以下内容:
[root@yunweixia.com ~]# /usr/bin/chronyc -n sources MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^? 10.10.0.11 1 6 377 61 -11.4s[ -11.4s] +/- 11.0s
在上述输出中,服务器10.10.0.11前面标有^?:
1.^意味着这是一台服务器
2.?表示此服务器当前不可用。
可以使用/usr/bin/chrnyc-n sources-v来获得显示输出中每列的进一步详细信息和解释。
一、解决方案
编辑/etc/chrony.conf,确保添加maxdistance参数。以下示例:
server win-samba.mydomain.com iburst driftfile /var/lib/chrony/drift maxdistance 16.0 # <--- if your NTP is a Windows Server, then use this as starting value. Adapt if necessary. makestep 1.0 3 rtcsync keyfile /etc/chrony.keys leapsectz right/UTC logdir /var/log/chrony
二、扩展阅读
From the chrony.conf man page:
By default, the maximum root distance is 3 seconds.
Setting maxdistance to a larger value can be useful to allow synchronisation with a server that only has a very infrequent connection to its sources and can accumulate a large dispersion between updates of its clock.
原创文章,作者:运维侠,如若转载,请注明出处:https://www.yunweixia.com/solutions/linux-chrony-windows-ntp-sync-failure-solution.html