ntpd 4.2.2 选择自身并间歇性同步失败,这是一个错误吗?

ntpd 4.2.2 选择自身并间歇性同步失败,这是一个错误吗?

问题

你好,我遇到了 ntp 问题。 ntpd 版本 4.2.2、rhel6 总是出现这种情况。 rhel7现在使用ntpd-4.2.6,但有些系统也使用ntpd-4.2.2。我有数百台机器运行 ntpd-4.2.2 但是其中一半同步失败并间歇性地自行选择。不知道为什么会出现这种现象?这是ntpd的bug吗?

client: dmsag(10.13.1.41)
SERVER: 10.13.2.1, 10.13.2.2

客户端NTP版本:

[[email protected]:/root]
#ntpd --version
ntpd: ntpd [email protected] Mon Dec 29 09:33:00 UTC 2014 (1)

客户端NTP配置:

[root@dmsag /root]
#cat /etc/ntp.conf

driftfile /var/lib/ntp/drift
pidfile /var/run/ntpd.pid
#logfile /var/log/ntp.log

# Access Control Support
restrict    default ignore
restrict -6 default ignore
restrict    127.0.0.1

restrict    10.13.2.1
restrict    10.13.2.2
# local clock
server 127.127.1.0
fudge 127.127.1.2 stratum 10


server 10.13.2.1 iburst minpoll 4 maxpoll 6 prefer
server 10.13.2.2 iburst minpoll 4 maxpoll 6

服务器NTP版本:

[root@r7f4a4100 ~]# ntpd --version
ntpd 4.2.6p5
ntpd [email protected] Sat Dec 20 11:11:28 UTC 2014 (1)

客户端与服务器之间存在包交换

[root@dmsag /root]
#tcpdump -i any host 10.13.2.2 and port 123 -nn
tcpdump: WARNING: Promiscuous mode not supported on the "any" device
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 96 bytes

13:05:44.366753 IP 10.13.1.41.123 > 10.13.2.2.123: NTPv4, Client, length 48
13:05:44.372187 IP 10.13.1.41.123 > 10.13.2.2.123: NTPv4, Client, length 48
13:05:44.366923 IP 10.13.2.2.123 > 10.13.1.41.123: NTPv4, Server, length 48
13:06:48.366735 IP 10.13.1.41.123 > 10.13.2.2.123: NTPv4, Client, length 48
13:06:48.366739 IP 10.13.1.41.123 > 10.13.2.2.123: NTPv4, Client, length 48
13:06:48.366896 IP 10.13.2.2.123 > 10.13.1.41.123: NTPv4, Server, length 48
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel

客户总是选择自己

[root@dmsag /root]
#ntpq -np
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*127.127.1.0     .LOCL.           5 l   63   64  377    0.000    0.000   0.001
 10.13.2.1       10.98.94.5       4 u   26   64  377    0.108   -9.741   4.278
 10.13.2.2       10.98.94.5       4 u   23   64  377    0.118  -12.981   5.226

NTP服务器

[root@dmsag /root]
#ssh 10.13.2.1
Last login: Thu Feb  9 13:02:29 2017 from testx.tbsite.net
[root@r7f4a4100 ~]# ntpq -np
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.1.0     .LOCL.           5 l  88m   64    0    0.000    0.000   0.000
*10.98.94.5      40.118.106.130   3 u   17   64  377    0.378   23.436  11.696
 10.13.2.1       .INIT.          16 u    -   16    0    0.000    0.000   0.000
+10.13.2.2       10.98.94.5       4 u   11   16  376    0.389    5.377   1.966

调试

斯特雷斯

[root@dmsag /root]
#strace -p 32121
Process 32121 attached - interrupt to quit
select(19, [16 17 18], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigreturn(0xe)                       = -1 EINTR (Interrupted system call)
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\1\0\1\0\0\0\0\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef4704, 1092, 0, 0x7fdf33ef45e0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\201\0\1\300\21\0\0\0\0\0\fqb\220\24qc\220\24qd\220\24", 24, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, 16) = 24
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\2\0\0qb\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef51f4, 1092, 0, 0x7fdf33ef50d0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\2\220\24qb\0\0\1\324srcadr=127.127.1.0, "..., 480, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\2\220\24qb\1\324\0\201offset= 0.00 0.00 0."..., 144, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, 16) = 144
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\3\0\0qc\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef5ce4, 1092, 0, 0x7fdf33ef5bc0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\3\220\24qc\0\0\1\322srcadr=10.13.2.1, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\3\220\24qc\1\322\0qfiltoffset= -8.65 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\4\0\0qd\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef67d4, 1092, 0, 0x7fdf33ef66b0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\4\220\24qd\0\0\1\322srcadr=10.13.2.2, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\4\220\24qd\1\322\0qfiltoffset= -9.52 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(55549), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigreturn(0xe)                       = -1 EINTR (Interrupted system call)
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\1\0\1\0\0\0\0\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef72c4, 1092, 0, 0x7fdf33ef71a0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\201\0\1\300\21\0\0\0\0\0\fqb\220\24qc\220\24qd\220\24", 24, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, 16) = 24
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\2\0\0qb\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef6d4c, 1092, 0, 0x7fdf33ef6c28, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\2\220\24qb\0\0\1\324srcadr=127.127.1.0, "..., 480, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\2\220\24qb\1\324\0\201offset= 0.00 0.00 0."..., 144, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, 16) = 144
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\3\0\0qc\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef4c7c, 1092, 0, 0x7fdf33ef4b58, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\3\220\24qc\0\0\1\322srcadr=10.13.2.1, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\3\220\24qc\1\322\0qfiltoffset= -8.65 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\4\0\0qd\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef576c, 1092, 0, 0x7fdf33ef5648, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\4\220\24qd\0\0\1\322srcadr=10.13.2.2, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\4\220\24qd\1\322\0qfiltoffset= -9.52 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(45660), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
--- SIGALRM (Alarm clock) @ 0 (0) ---
rt_sigreturn(0xe)                       = -1 EINTR (Interrupted system call)
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\1\0\1\0\0\0\0\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef625c, 1092, 0, 0x7fdf33ef6138, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\201\0\1\300\21\0\0\0\0\0\fqb\220\24qc\220\24qd\220\24", 24, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, 16) = 24
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\2\0\0qb\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef783c, 1092, 0, 0x7fdf33ef7718, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\2\220\24qb\0\0\1\324srcadr=127.127.1.0, "..., 480, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\2\220\24qb\1\324\0\201offset= 0.00 0.00 0."..., 144, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, 16) = 144
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\3\0\0qc\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef4704, 1092, 0, 0x7fdf33ef45e0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\3\220\24qc\0\0\1\322srcadr=10.13.2.1, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\3\220\24qc\1\322\0qfiltoffset= -8.65 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\4\0\0qd\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef51f4, 1092, 0, 0x7fdf33ef50d0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\4\220\24qd\0\0\1\322srcadr=10.13.2.2, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\4\220\24qd\1\322\0qfiltoffset= -9.52 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(37351), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\1\0\1\0\0\0\0\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef5ce4, 1092, 0, 0x7fdf33ef5bc0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\201\0\1\300\21\0\0\0\0\0\fqb\220\24qc\220\24qd\220\24", 24, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, 16) = 24
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\2\0\0qb\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef67d4, 1092, 0, 0x7fdf33ef66b0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\2\220\24qb\0\0\1\324srcadr=127.127.1.0, "..., 480, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\2\220\24qb\1\324\0\201offset= 0.00 0.00 0."..., 144, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, 16) = 144
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\3\0\0qc\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef72c4, 1092, 0, 0x7fdf33ef71a0, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\3\220\24qc\0\0\1\322srcadr=10.13.2.1, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\3\220\24qc\1\322\0qfiltoffset= -8.65 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = 1 (in [17])
select(19, [16 17 18], NULL, NULL, {0, 0}) = 1 (in [17], left {0, 0})
recvfrom(17, "\26\2\0\4\0\0qd\0\0\0\0", 1092, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12
recvfrom(17, 0x7fdf33ef6d4c, 1092, 0, 0x7fdf33ef6c28, 0x7fffe66de59c) = -1 EAGAIN (Resource temporarily unavailable)
sendto(17, "\326\242\0\4\220\24qd\0\0\1\322srcadr=10.13.2.2, sr"..., 480, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, 16) = 480
sendto(17, "\326\202\0\4\220\24qd\1\322\0qfiltoffset= -9.52 -9"..., 128, 0, {sa_family=AF_INET, sin_port=htons(52421), sin_addr=inet_addr("127.0.0.1")}, 16) = 128
select(19, [16 17 18], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)

ntpd调试信息

[root@dmsag /root]
#ntpd -d
ntpd [email protected] Mon Dec 29 09:33:00 UTC 2014 (1)
addto_syslog: precision = 1.000 usec
create_sockets(123)
addto_syslog: no IPv6 interfaces found
addto_syslog: ntp_io: estimated max descriptors: 655360, initial socket boundary: 16
bind() fd 16, family 2, port 123, addr 0.0.0.0, flags=9
Added addr 0.0.0.0 to list of addresses
addto_syslog: Listening on interface wildcard, 0.0.0.0#123 Disabled
bind() fd 17, family 2, port 123, addr 127.0.0.1, flags=5
Added addr 127.0.0.1 to list of addresses
addto_syslog: Listening on interface lo, 127.0.0.1#123 Enabled
bind() fd 18, family 2, port 123, addr 10.13.1.41, flags=25
Added addr 10.13.1.41 to list of addresses
addto_syslog: Listening on interface bond0, 10.13.1.41#123 Enabled
init_io: maxactivefd 18
local_clock: time 0 base 0.000000 offset 0.000000 freq 0.000 state 0
addto_syslog: frequency initialized 51.952 PPM from /var/lib/ntp/drift
key_expire: at 0
peer_clear: at 0 next 1 assoc ID 57098 refid INIT
newpeer: 127.0.0.1->127.127.1.0 mode 3 vers 4 poll 6 10 flags 0x1021 0x1 ttl 0 key 00000000
key_expire: at 0
peer_clear: at 0 next 2 assoc ID 57099 refid INIT
newpeer: 10.13.1.41->10.13.2.1 mode 3 vers 4 poll 4 6 flags 0x281 0x1 ttl 0 key 00000000
key_expire: at 0
peer_clear: at 0 next 3 assoc ID 57100 refid INIT
newpeer: 10.13.1.41->10.13.2.2 mode 3 vers 4 poll 4 6 flags 0x201 0x1 ttl 0 key 00000000
local_clock: time 0 base 0.000000 offset 0.000000 freq 51.952 state 1
report_event: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010)
refclock_transmit: at 1 127.127.1.0
refclock_receive: at 1 127.127.1.0
peer LOCAL(0) event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000001
clock_filter: n 1 off 0.000000 del 0.000000 dsp 7.937500 jit 0.000001, age 0
auth_agekeys: at 1 keys 1 expired 0
timer: refresh ts 0
transmit: at 2 10.13.1.41->10.13.2.1 mode 3
receive: at 2 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
peer 10.13.2.1 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
clock_filter: n 1 off -0.003512 del 0.000076 dsp 7.937501 jit 0.000001, age 0
transmit: at 3 10.13.1.41->10.13.2.2 mode 3
receive: at 3 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
peer 10.13.2.2 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0x8014)
clock_filter: n 1 off -0.016462 del 0.000136 dsp 7.937501 jit 0.000001, age 0
transmit: at 4 10.13.1.41->10.13.2.1 mode 3
receive: at 4 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 2 off -0.003512 del 0.000076 dsp 3.937516 jit 0.000001, age 2
transmit: at 5 10.13.1.41->10.13.2.2 mode 3
receive: at 5 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 2 off -0.016537 del 0.000132 dsp 3.937508 jit 0.000075, age 0
transmit: at 6 10.13.1.41->10.13.2.1 mode 3
receive: at 6 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 3 off -0.003512 del 0.000076 dsp 1.937538 jit 0.000008, age 4
transmit: at 7 10.13.1.41->10.13.2.2 mode 3
receive: at 7 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 3 off -0.016604 del 0.000129 dsp 1.937516 jit 0.000111, age 0
transmit: at 8 10.13.1.41->10.13.2.1 mode 3
receive: at 8 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 4 off -0.003512 del 0.000076 dsp 0.937565 jit 0.000011, age 6
transmit: at 9 10.13.1.41->10.13.2.2 mode 3
receive: at 9 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 4 off -0.016604 del 0.000129 dsp 0.937537 jit 0.000099, age 2
transmit: at 10 10.13.1.41->10.13.2.1 mode 3
receive: at 10 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 5 off -0.003512 del 0.000076 dsp 0.437593 jit 0.000013, age 8
transmit: at 11 10.13.1.41->10.13.2.2 mode 3
receive: at 11 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 5 off -0.016745 del 0.000128 dsp 0.437533 jit 0.000192, age 0
transmit: at 12 10.13.1.41->10.13.2.1 mode 3
receive: at 12 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 6 off -0.003512 del 0.000076 dsp 0.187620 jit 0.000015, age 10
transmit: at 13 10.13.1.41->10.13.2.2 mode 3
receive: at 13 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 6 off -0.016745 del 0.000128 dsp 0.187558 jit 0.000175, age 2
transmit: at 14 10.13.1.41->10.13.2.1 mode 3
receive: at 14 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 7 off -0.003512 del 0.000076 dsp 0.062639 jit 0.000019, age 12
transmit: at 15 10.13.1.41->10.13.2.2 mode 3
receive: at 15 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 7 off -0.016886 del 0.000129 dsp 0.062544 jit 0.000274, age 0
transmit: at 16 10.13.1.41->10.13.2.1 mode 3
receive: at 16 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 8 off -0.003512 del 0.000076 dsp 0.000167 jit 0.000020, age 14
transmit: at 17 10.13.1.41->10.13.2.2 mode 3
receive: at 17 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 8 off -0.016886 del 0.000129 dsp 0.000066 jit 0.000255, age 2
transmit: at 18 10.13.1.41->10.13.2.1 mode 3
receive: at 18 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 8 off -0.003512 del 0.000106 dsp 0.000136 jit 0.000023, age 14
transmit: at 19 10.13.1.41->10.13.2.1 mode 3
key_expire: at 19
transmit: at 19 10.13.1.41->10.13.2.2 mode 3
receive: at 19 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 8 off -0.017033 del 0.000112 dsp 0.000048 jit 0.000320, age 0
receive: at 19 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 8 off -0.003543 del 0.000110 dsp 0.000060 jit 0.000012, age 5
transmit: at 20 10.13.1.41->10.13.2.2 mode 3
key_expire: at 20
receive: at 20 10.13.1.41<-10.13.2.2 mode 4 code 1 auth 0
clock_filter: n 8 off -0.017033 del 0.000112 dsp 0.000035 jit 0.000260, age 1
transmit: at 35 10.13.1.41->10.13.2.1 mode 3
receive: at 35 10.13.1.41<-10.13.2.1 mode 4 code 1 auth 0
clock_filter: n 8 off -0.003543 del 0.000110 dsp 0.000271 jit 0.000018, age 21

答案1

我认为你当地时钟的层太高了。它应该比您想要同步的时钟至少低 2 个级别。本地时钟的推荐配置为:

单一时间服务器:

# local clock
server 127.127.1.0
fudge  127.127.1.0 stratum 10

你有:

# local clock
server 127.127.1.0
fudge 127.127.1.2 stratum 10

您的 ntpq:

#ntpq -np
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*127.127.1.0     .LOCL.           5 l   63   64  377    0.000    0.000   0.001
 10.13.2.1       10.98.94.5       4 u   26   64  377    0.108   -9.741   4.278
 10.13.2.2       10.98.94.5       4 u   23   64  377    0.118  -12.981   5.226

这显示了第 5 层的本地时钟,而不是第 10 层。完美的时钟,它被使用。

(来源

相关内容