linux_wiki:synchronize_time_using_other_ntp_peers

This is an old revision of the document!


Synchronize Time Using Other NTP Peers

General Information

Synchronizing time to a central time server and also keeping in sync with a peer server.

This type of setup would be a tier two NTP setup, allowing for redundancy if the central source of time is lost. The two peers could agree on a time and provide it locally to other servers.


NTP: Time Server

Setting up a local NTP server in order to practice the objective of synchronizing time.


Install the ntp package

yum install ntp


Enable and start ntpd

systemctl enable ntpd
systemctl start ntpd


Query NTP to view status

ntpq -p
  • -p →


NTP Statistics

ntpstat


Configure NTP Pool Sources

vim /etc/ntpd.conf
 
# Comment out other servers, add the below
server 127.127.1.0
  • 127.127.1.0 → Special IP address that syncs to the local server's clock


Restart the service for the change to apply

systemctl restart ntpd


Open the firewall for NTP

firewall-cmd --permanent --add-service=ntp
firewall-cmd --reload

NTP: Client Peering

Setup a NTP client to peer/sync with the NTP server.


Install required package

yum install ntp


Enable and start the service

systemctl enable ntpd
systemctl start ntpd


Edit the NTP config file

vim /etc/ntp.conf
 
# Comment out all server lines, add peer for the newly created NTP server
peer 192.168.1.200


Restart the service

systemctl restart ntpd


Open the firewall for ntp

firewall-cmd --permanent --add-service=ntp
firewall-cmd --reload

  • linux_wiki/synchronize_time_using_other_ntp_peers.1475962214.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)