linux 设置时间同步服务器后,时间未同步

逍遥哥哥吖 2012-04-20 03:10:18
时间服务器主机:10.128.6.8 时间服务器客户端:10.128.6.134

要求:每天晚上12点客户端同步服务器时间,采用ntp设置

服务器ntp.conf文件配置如下:
restrict 127.0.0.1
restrict 10.128.6.134
restrict 10.128.6.0 mask 255.255.255.192 nomodify notrap
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
broadcastdeley 0.008
authenticate no
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys


客户端ntp.conf文件配置如下:
restrict 127.0.0.1
restrict 10.128.6.0 mask 255.255.255.192 nomodify notrap
server 10.128.6.8
broadcastdeley 0.008
authenticate no
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys

客户端设置contab任务,执行crontab -e ,设置内容如下:

0 * * * * /usr/sbin/ntpdate 10.128.6.8 >>/var/log/ntpdate.log

启动服务器:service ntpd start;

服务端执行,watch ntpq -p 显示如下:

Every 2.0s: ntpq -p Fri Apr 20 15:08:34 2012

remote refid st t when poll reach delay offset jitter
==============================================================================
*LOCAL(0) .LOCL. 10 l 22 64 377 0.000 0.000 0.001



客户端执行,watch ntpq -p 显示如下:
Every 2.0s: ntpq -p Fri Apr 20 15:10:09 2012

remote refid st t when poll reach delay offset jitter
==============================================================================
10.128.6.8 .INIT. 16 u - 1024 0 0.000 0.000 0.000
*LOCAL(0) .LOCL. 10 l 48 64 377 0.000 0.000 0.001


客户端执行:ntpdate -d 10.128.6.8,提示信息如下:
20 Apr 15:11:22 ntpdate[9444]: ntpdate 4.2.2p1@1.1570-o Thu May 14 13:01:42 UTC 2009 (1)
Looking for host 10.128.6.8 and service ntp
host found : 10.128.6.8
transmit(10.128.6.8)
transmit(10.128.6.8)
transmit(10.128.6.8)
transmit(10.128.6.8)
transmit(10.128.6.8)
10.128.6.8: Server dropped: no data
server 10.128.6.8, port 123
stratum 0, precision 0, leap 00, trust 000
refid [10.128.6.8], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Thu, Feb 7 2036 14:28:16.000
originate timestamp: 00000000.00000000 Thu, Feb 7 2036 14:28:16.000
transmit timestamp: d33b8a9d.245fe111 Fri, Apr 20 2012 15:11:25.142
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000

20 Apr 15:11:26 ntpdate[9444]: no server suitable for synchronization found


查了下no server suitable for synchronization found的原因,但仍无法解决。



...全文
312 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
逍遥哥哥吖 2012-04-24
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]
restrict 10.128.6.0 mask 255.255.255.192 nomodify notrap
提供服务范围为 10.128.6.193~10.128.6.255,10.128.6.134不在范围内
改为:
restrict 10.128.6.0 mask 255.255.255.0 nomodify notrap
[/Quote]

问题解决,网管只是把端口开了.还是谢谢了
逍遥哥哥吖 2012-04-23
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]
restrict 10.128.6.0 mask 255.255.255.192 nomodify notrap
提供服务范围为 10.128.6.193~10.128.6.255,10.128.6.134不在范围内
改为:
restrict 10.128.6.0 mask 255.255.255.0 nomodify notrap
[/Quote]


仍然不行。。。
root_jli 2012-04-20
  • 打赏
  • 举报
回复
restrict 10.128.6.0 mask 255.255.255.192 nomodify notrap
提供服务范围为 10.128.6.193~10.128.6.255,10.128.6.134不在范围内
改为:
restrict 10.128.6.0 mask 255.255.255.0 nomodify notrap
逍遥哥哥吖 2012-04-20
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
ntp使用udp协议,123端口是否开放?
[/Quote]

开放的
root_jli 2012-04-20
  • 打赏
  • 举报
回复
ntp使用udp协议,123端口是否开放?

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧