United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
After configuring ntp client sync with the ntp server, occasionally the sync is not accurate. In some critical enviroments even 2 or 3 seconds is not allowed. The example below shows how to make the sync more accurate.
Edit the /etc/sysconfig/ntpd, which is the key configuration for ntpd. Add , the output is as below:
# Set to 'yes' to sync hw clock after successful ntpdate. SYNC_HWCLOCK=yes
All the servers have two kinds of clocks; the system clock and the hardware clock. The system clock is owned by the OS, and the hardware clock is owned by CMOS. When the Server is running, it usually provides it's system clock as the clock resource. However, when the server is shutdown, the system clock will sync to hardware and when rebooted the hardware clock will sync to system.
The problem occurs because their may be some offset between the two clocks, and if the server has been shutdown for a longtime, when it's rebooted the hardware clock may sync to system that may not be accurate.
If SYNC_HWCLOCK=yes is used in /etc/sysconfig/ntpd, it means when the ntpd is startd it will first sync with hardware clock, that will reduce the offset and error between the two clocks.
The ntpdate command can be set in cronjob, but it's not recommended, because ntpdate will directly sync the two clock but ntpd makes the sync little by little. So if the deviation between the two clocks is very big, the adjustment of ntpdate will make cause problems with others services, for example syslogd and klogd.