【问题标题】:NTP client Undisciplined Local Clock [closed]NTP客户端无纪律的本地时钟[关闭]
【发布时间】:2013-01-31 15:50:59
【问题描述】:

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

# 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

【问题讨论】:

  • 全部在 cmets 中:它旨在作为备用源(stratum = 10 表示:低质量,非首选)您可以使用 ntpdc -p 检查您的实际时钟源,其中还有一个很好的手册页。
  • 我的客户端真的需要那个吗?
  • 我不知道虚拟机的特殊性;在普通机器上,将坏层本地时钟作为后备设备并不是那么糟糕,尤其是在漂移已经解决后。但也许在虚拟机上,对硬件时钟的写入(大约每 20 分钟)不是持久的,或者只是完全错误的。在任何情况下:总是需要网络时钟源(并且一旦存在就首选)

标签: linux vmware ntp


【解决方案1】:

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

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

0.vmware.pool.ntp.org
1.vmware.pool.ntp.org

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

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

同样重要的是不要使用本地时钟作为时间源,通常称为无纪律本地时钟。当存在大量时间漂移时,NTP 倾向于回退到远程服务器而不是远程服务器。

这种配置的一个例子是:

server 127.127.1.0
fudge 127.127.1.0 stratum 10

注释掉这两行。

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

来源:VMWare Knowledge Base

【讨论】:

  • 也许您可以提及 tos orphan 10 作为旧本地(无纪律)设置的后备...较新版本的 NTP 都支持该选项。
猜你喜欢
  • 2013-10-21
  • 2012-06-01
  • 2010-10-29
  • 2014-04-12
  • 1970-01-01
  • 1970-01-01
  • 2014-01-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多