NTP客户端无纪律的本地时钟

Sat*_*ish -1 linux vmware ntp

我们有VM使用ntp客户端来同步时间.以下是我的配置.我的问题是我server 127.127.1.0 # local clock在客户端ntp.conf文件中需要行吗?如果是,那么为什么?

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface.
restrict 127.0.0.1
restrict -6 ::1
server ntp1.example.com
server ntp2.example.com
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
Run Code Online (Sandbox Code Playgroud)

Sat*_*ish 7

NTP建议书

注意: VMware建议您使用NTP而不是VMware Tools定期时间同步.NTP是行业标准,可确保您的客人准确计时.您可能必须打开防火墙(UDP 123)才能允许NTP流量.

这是一个样本 /etc/ntp.conf

tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
server 2.vmware.pool.ntp.org
driftfile /var/lib/ntp/drift
Run Code Online (Sandbox Code Playgroud)

这是一个示例(特定于RedHat)/etc/ntp/step-tickers:

0.vmware.pool.ntp.org
1.vmware.pool.ntp.org
Run Code Online (Sandbox Code Playgroud)

配置指令tinker panic 0指示NTP如果看到大的时间跳跃则不要放弃.这对于应对大量时间漂移以及从暂停状态恢复虚拟机非常重要.

注意:该指令tinker panic 0必须位于ntp.conf文件的顶部.

同样重要的是不要将本地时钟用作时间源,通常称为无纪律本地时钟.当存在大量时间漂移时,NTP倾向于优先于远程服务器.

这种配置的一个例子是:

server 127.127.1.0
fudge 127.127.1.0 stratum 10
Run Code Online (Sandbox Code Playgroud)

注释掉这两行.

更改NTP配置后,必须重新启动NTP守护程序.请参阅操作系统供应商的文档.

来源:VMWare知识库