發現chronyd配置好后,狀態也可以,就是沒有同步
systemctl status chronyd
這個時候查看手冊
[root@POC_STRADE02 ~]# man chrony.conf |grep maxdistance
maxdistance distance
The maxdistance directive sets the maximum allowed root distance of the sources to not be rejected by the source selection algorithm. The distance includes the accumulated dispersion, which might be large
when the source is no longer synchronised, and half of the total round-trip delay to the primary source.
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.
[root@POC_STRADE02 ~]#
這段的坑是,當服務器重啟后,讀取硬件時鍾的時間如果和chronyd同步的源時間相差3秒以上,就不會進行同步
需要再配置文件里最后一行加一段配置,
vim /etc/chrony.conf
加入如下,我設置的是600秒
maxdistance 600.0