【发布时间】:2018-09-11 17:04:30
【问题描述】:
我正在尝试在无法访问 Internet 的本地网络中配置 NTP 服务器(即使错误,我也需要所有机器都具有相同的时间)。
我已经为客户端和服务器配置了 /etc/ntp.conf 文件。
在系统启动时,我运行ntpd -qgx 来同步启动时间以加快同步速度,然后运行ntpd 继续同步。
但是有时它会成功同步,而其他时候它给了我:
select() 返回 -1:系统调用中断
select() 返回 -1:系统调用中断
1 Jan 00:02:56 ntpd[2599]:ntpd:未找到服务器
我真的试图找到一种模式来理解它何时失败......但对我来说没有成功,这完全是随机的。
当我尝试使用 google 的 NTP 服务器时,它看起来不错,并且每次都确实同步
有人遇到过这样的问题吗?有什么想法吗?
我的 ntp.conf 文件:
服务器:
#Use the local clock
server 127.127.1.0
fudge 127.127.1.0 stratum 0
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
# Give localhost full access rights
restrict 127.0.0.1
# Give machines on our network access to query us
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
客户:
#Point to our network's master time server
server 192.168.1.102
#restrict default ignore
restrict 127.0.0.1
restrict 192.168.1.102 mask 255.255.255.255 nomodify notrap noquery
tos orphan 16
driftfile /var/lib/ntp/drift
【问题讨论】:
标签: linux time synchronization ntp local-network