【发布时间】: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 分钟)不是持久的,或者只是完全错误的。在任何情况下:总是需要网络时钟源(并且一旦存在就首选)