执行ntpdate报错:no server suitable for synchronization found

最近在执行

ntpdate {ntp-server-ip}

报如下错误:

no server suitable for synchronization found
ntpdate -d {ntp-server-ip} #打开debug,可以看到:
Server dropped: Strata too high 

这是因为NTP server还没有和其自身或者它的server同步上。
以下的定义是让NTP Server和其自身对峙同步,在/etc/ntp.conf中将local作为ntp server提供给ntp客户端。

server 127.127.1.0 
fudge 127.127.1.0 stratum 8 

it is able to fudge itself (127.127.1.0 is the local ntpd server address, 8 is a number less than 16) (remember to restart ntpd). (fudge:蒙混过关,fudge itself自欺欺人)

chronyd server设置

如果服务端是chrony的话,需要修改chrony的conf文件/etc/chrony.conf
加入如下:

server 127.127.1.0 prefer
allow all
stratumweight 0
local stratum 10

重启systemctl restart chronyd

注意:目前总遇到一定时间后仍然报no server suitable

重启chronyd ==!!

你可能感兴趣的:(执行ntpdate报错:no server suitable for synchronization found)