ntpdate -d
no server suitable
即使它成功连接到服务器并打印偏移量,有时也会打印错误。为什么?
在我的脚本中需要区分网络错误和这一错误。如何强制其以零状态退出?
好的:
# ntpdate -d 10.3.2.67
12 Nov 13:23:21 ntpdate[6565]: ntpdate [email protected] Mon Jul 15 09:22:50 UTC 2013 (1)
Looking for host 10.3.2.67 and service ntp
host found : ec-prod-app-1
transmit(10.3.2.67)
receive(10.3.2.67)
transmit(10.3.2.67)
receive(10.3.2.67)
transmit(10.3.2.67)
receive(10.3.2.67)
transmit(10.3.2.67)
receive(10.3.2.67)
server 10.3.2.67, port 123
stratum 4, precision -21, leap 00, trust 000
refid [10.3.2.67], delay 0.02574, dispersion 0.00000
transmitted 4, in filter 4
reference time: d9eee40d.738ce7c1 Thu, Nov 12 2015 13:10:21.451
originate timestamp: d9eee719.a97c80cf Thu, Nov 12 2015 13:23:21.662
transmit timestamp: d9eee719.a9245fa8 Thu, Nov 12 2015 13:23:21.660
filter delay: 0.02579 0.02586 0.02574 0.02574
0.00000 0.00000 0.00000 0.00000
filter offset: 0.001251 0.001187 0.001244 0.001243
0.000000 0.000000 0.000000 0.000000
delay 0.02574, dispersion 0.00000
offset 0.001244
12 Nov 13:23:21 ntpdate[6565]: adjust time server 10.3.2.67 offset 0.001244 sec
坏的:
# ntpdate -d 10.3.2.68
12 Nov 13:23:24 ntpdate[6566]: ntpdate [email protected] Mon Jul 15 09:22:50 UTC 2013 (1)
Looking for host 10.3.2.68 and service ntp
host found : ec-prod-app-2
transmit(10.3.2.68)
receive(10.3.2.68)
transmit(10.3.2.68)
receive(10.3.2.68)
transmit(10.3.2.68)
receive(10.3.2.68)
transmit(10.3.2.68)
receive(10.3.2.68)
10.3.2.68: Server dropped: strata too high
server 10.3.2.68, port 123
stratum 16, precision -20, leap 11, trust 000
refid [10.3.2.68], delay 0.02574, dispersion 0.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Mon, Jan 1 1900 3:00:00.000
originate timestamp: d9eee71b.a14c710c Thu, Nov 12 2015 13:23:23.630
transmit timestamp: d9eee71c.5e083201 Thu, Nov 12 2015 13:23:24.367
filter delay: 0.02577 0.02574 0.02574 0.02577
0.00000 0.00000 0.00000 0.00000
filter offset: -0.73732 -0.73732 -0.73733 -0.73734
0.000000 0.000000 0.000000 0.000000
delay 0.02574, dispersion 0.00000
offset -0.737324
12 Nov 13:23:24 ntpdate[6566]: no server suitable for synchronization found
答案1
您是否注意到:
10.3.2.68: Server dropped: strata too high
还有:
stratum 16, precision -20, leap 11, trust 000
你的输出中有几行?
客户ntp
端认为时间源不够健全(即没有与较低层服务器同步)