当服务器与NTP服务器同步时,是否有任何方法定期同步硬件时钟?我正在使用Centos 6.7。以下是我的ntp.conf文件内容
# File for including partners custom ntp configurations
leapfile "/etc/ntp/leap-seconds.list"
# Permit general access to this service.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1
# Replacement for the Undisciplined Local Clock. Allows a
# group of ntpds to autonomously select a leader in the
# event that all real time sources become unreachable.
tos orphan 10
# NTP Drift file.
# Put this in a directory to which the daemon can write.
# No symbolic links allowed, either, since daemon renames.
driftfile /var/lib/ntp/drift
# Key file containing the keys and key identifiers used
# when operating with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
server 127.127.1.0 # local clock
server x.x.x.x发布于 2016-02-23 15:52:37
您可以在root的crontab中尝试以下操作:
1 0 * * * /usr/sbin/hwclock --systohc这将每天同步,午夜后,不要忘记--utc标志,如果你的主板时钟在世界协调时。如果您的硬件时钟漂移如此之快,它需要纠正超过一天,你可能有更大的问题!
发布于 2016-02-23 15:53:12
通常,RHEL和CentOS在ntpdate init脚本优雅重新启动和关闭期间从系统时间同步硬件时钟。
没有什么能阻止您通过从cron作业调用/sbin/hwclock --systohc来稍微频繁地这样做。
https://serverfault.com/questions/759215
复制相似问题