我想让Stratum 1服务器中的本地te时钟成为我网络的网络时间源(我不想要带有天线的Stratum 0服务器)。我怎样才能在网络中设置这个呢?是否有说明如何使用网络时间协议并设置此协议的教程?到目前为止,我还没有在谷歌上找到任何关于如何实现这一目标的信息。我非常感谢你的帮助。
发布于 2022-11-20 18:12:13
与现代设备所期望的精确性相比,通用计算机中的时钟是垃圾。没有精确校准,服务器的热变化会导致漂移发生变化。因此,在极端情况下,它需要一些方法进行更新,否则最终会变得不准确。有时候,仅仅让时钟保持一致就足够了,但人们往往会期望更好。
继续进行实际的配置。例如,在Linux上,chrony很流行,它具有手动设置时钟和处理断开连接的功能。从关于时间守时的RHEL文档这样的例子开始,参考“时间手册”作为参考。
大多数时间服务器至少有一个互联网接入,一个卫星导航天线,或精确的时钟硬件。默认情况下,如果时间是通过NTP从参考时钟中产生的,它将服务时间。将允许指令设置到您的网络并使用您的NTP服务器。但是,如果您没有这些命令,则可以使用本地指令使时间同步服务时间。
如果这是一个没有时间硬件的空隙网络,也可以启用手动指令,所以您可以使用chronyc settime手动告诉它时间。
带着这些内容的chrony.conf,关于可以用于NTP服务器的一些评论,以及我喜欢的EL默认配置中的一些内容:
# chrony.conf that still serves time if not syncronized
# Options for time sources
# NTP appliance
# For example, sat nav modules are inexpensive
# Assuming it is available over IP, it is an NTP server
#server time.zone.example.net iburst
# Isolated computers need software updates too!
# If there is an update server on the local net via IP,
# it can serve NTP as well as patches
#server updateproxy.example.net iburst
# Public internet NTP
# Use if you actually have internet
# But no local time source somehow
#pool 2.pool.ntp.org iburst
# Pretend local clock is syncronized
# Enabling serving time
# Use a high stratum, as a lower priority over better clocks
local stratum 10
# Allow "chronyc settime"
# Run this with input time based on e.g. a watch or other clock
# Regularly and when the time is wrong
manual
# Allow clients to query this server
# Replace with your local net prefix
allow 2001:db8:2ea1::/48
### End source customization
### Begin other configuration
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
logdir /var/log/chrony
log measurements statistics trackinghttps://serverfault.com/questions/1115681
复制相似问题