Installing and configuring an NTP master server
- Log in to the master host node as root, or as a user with superuser privileges.
Install the NTP package.
yum --disablerepo=\* --enablerepo=zenoss-mirror install -y ntp
Create a backup of the NTP configuration file.
cp -p /etc/ntp.conf /etc/ntp.conf.orig
Edit the NTP configuration file./
- Open /etc/ntp.conf with a text editor.
Replace all of the lines in the file with the following lines:
# Use the local clock server 127.127.1.0 prefer fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift broadcastdelay 0.008 # Give localhost full access rights restrict 127.0.0.1 # Grant access to client hosts restrict ADDRESS_RANGE mask NETMASK nomodify notrap
Replace ADDRESS_RANGE with the range of IPv4 network addresses
that are allowed to query this NTP server.
For example, the following IP addresses are assigned to the hosts in an Control Center cluster:
For the preceding addresses, the value for ADDRESS_RANGE is 203.0.113.0.
Replace NETMASK with the IPv4 network mask
that corresponds with the address range.
For example, a valid network mask for 203.0.113.0 is 255.255.255.0.
- Save the file and exit the editor.
Enable and start the NTP daemon.
Enable the ntpd daemon.
systemctl enable ntpd
Configure ntpd to start when the system starts.
Currently, an unresolved issue associated with NTP prevents ntpd from restarting correctly after a reboot, and the following commands provide a workaround to ensure that it does.
echo "systemctl start ntpd" >> /etc/rc.d/rc.local chmod +x /etc/rc.d/rc.local
systemctl start ntpd
- Enable the ntpd daemon.