This post describes how to configure the ntpd service to utilize the local system clock source in the event of connectivity loss to upstream NTP time sources. This can be useful for Oracle RAC or other clustered environments where peer nodes may fence (restart) as a result of time inconsistency across a cluster.
To cater for potential loss of connectivity with upstream NTP servers, the local system clock can be added as a fallback clock source in the NTP configuration.
Using the fudge command to add the local clock as a stratum 15 server ensures the local clock will not be used unless connection with upstream NTP servers is lost.
Perform the following to accomplish the task:
1. Append the following lines to NTP configuration file /etc/ntp.conf:
server 127.127.1.1 fudge 127.127.1.1 stratum 15
2. Check the time reported by the hardware clock. For example:
# /usr/sbin/hwclock -r; date
If the time reported by the hardware clock is the same as that from the current system time (via the date(1) command), restart the ntpd service.
If not, set the hardware clock from the current NTP-synchronised system time as follows, then restart the ntpd service:
# /usr/sbin/hwclock -w
3. Restart the NTP service for the changes to take effect:
# service ntpd restart