现象:
#ntpstat
unsynchronised
time server re-starting
polling server every 8 s
解决方法:
查看NTP服务端和客户端的防火墙是否放行udp 123
#ntpstat
synchronised to NTP server (18.18.220.186) at stratum 3
time correct to within 183 ms
polling server every 128 s
参考,转载自https://www.linuxquestions.org/questions/linux-server-73/ntp-client-error-ntpstat-shows-unsynchronised-749641/
Hi All,
I am no expert in NTP But I have configured NTP Client many times, But this time something is going wrong.
This is my /etc/ntp.conf
Code:
[root@browser1 ~]# cat /etc/ntp.conf
restrict default ignore
restrict 127.0.0.1
server 10.2.29.26 prefer
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
authenticate yes
keys /etc/ntp/keys
Drift File
Code:
[root@browser1 ~]# cat /var/lib/ntp/drift
0.000
My NTP Server 10.2.29.26
Code:
[root@browser1 ~]# ntpq -p 10.2.29.26
remote refid st t when poll reach delay offset jitter
==============================================================================
SHM(0) .MSF. 0 l - 64 0 0.000 0.000 4000.00
*SHM(1) .GPS. 0 l 139 16 377 0.000 -0.021 0.022
255.255.255.255 .BCST. 16 - - 64 0 0.000 0.000 4000.00
/var/log/messages on restarting NTP server, there is nothing else relating to NTP. I am not sure even if there should be anything relating to time sync etc.
Code:
Aug 23 11:13:11 browser1 ntpd: ntpd shutdown succeeded
Aug 23 11:13:11 browser1 ntpd: ntpd startup succeeded
Other commands
Code:
[root@browser1 ~]# /usr/sbin/ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
10.2.29.26 .INIT. 16 u - 64 0 0.000 0.000 4000.00
[root@browser1 ~]# /usr/sbin/ntpq -n -c peers
remote refid st t when poll reach delay offset jitter
==============================================================================
10.2.29.26 .INIT. 16 u - 64 0 0.000 0.000 4000.00
[root@browser1 ~]# ntpstat
unsynchronised
time server re-starting
polling server every 64 s
[root@browser1 ~]# ntpdate -buv 10.2.29.26
23 Aug 11:17:19 ntpdate[17340]: ntpdate 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EDT 2006 (1)
23 Aug 11:15:04 ntpdate[17340]: step time server 10.2.29.26 offset -135.099450 sec
Why is ntpstat still unsynchrnoized ?
Am I missing something ? Please Help .!!
If things does not work, I will have to put this in crontab.
Code:
60 * * * * /usr/sbin/ntpdate -u 10.2.29.26 &>/dev/null
=========================================================
Hi vikas027,
I’d have to guess a firewall issue, can you confirm 123/udp inbound to the client ?
thanks,
kbp
Last edited by kbp; 08-23-2009 at 10:21 AM. Reason: typo