最近在執(zhí)行
ntpdate {ntp-server-ip}
報(bào)如下錯誤:
no server suitable for synchronization found
ntpdate -d {ntp-server-ip} #打開debug,可以看到:
Server dropped: Strata too high
這是因?yàn)镹TP 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:蒙混過關(guān),fudge itself自欺欺人)
chronyd server設(shè)置
如果服務(wù)端是chrony的話及刻,需要修改chrony的conf文件/etc/chrony.conf
加入如下:
server 127.127.1.0 prefer
allow all
stratumweight 0
local stratum 10
重啟systemctl restart chronyd
注意:目前總遇到一定時間后仍然報(bào)no server suitable
重啟chronyd ==!!