Time Synchronization with NTP | System Administration
Network Time Protocol – System Administration
We are going to show you a simple and handy way to setup NTP over single/multiple servers connected to a network for time synchronization.
What is NTP?
Network Time Protocol (NTP) is a networking protocol for Clock synchronization between computer systems over packet-switched data networks. Basically, a client requests the current time from a server and uses it to set its own clock. Learn More
- Our example includes Ubuntu (Linux) server running APACHE and PHP.
- SSH access to your Linux server with “sudo privileges”.
NTP Poll Client Installation
$ apt-get install ntp
Edit /etc/ntp.conf to add/remove server lines. By default these servers are configured:
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for # more information. server 0.ubuntu.pool.ntp.org server 1.ubuntu.pool.ntp.org server 2.ubuntu.pool.ntp.org server 3.ubuntu.pool.ntp.org
Our Server is located in N.Virginia region which is in North America, therefore I am using NTP Pool Servers which are falling in North America Region. You can adjust them according to the location of Your server. Just need to comment out default servers listed in ntp.conf file above. Use link to find your server Location: NTP Server Location
server 0.north-america.pool.ntp.org server 1.north-america.pool.ntp.org server 2.north-america.pool.ntp.org server 3.north-america.pool.ntp.org
NTP Service Restart
$ sudo /etc/init.d/ntp restart
$ sudo systemctl reload ntp.service
$ sudo ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== +stratum2-2.NTP. 184.108.40.206 2 u 5 64 377 68.461 -44.274 110.334 +ntp2.m-online.n 220.127.116.11 2 u 5 64 377 54.629 -27.318 78.882 *18.104.22.168 .DCFa. 1 u 10 64 377 83.607 -30.159 68.343 +stratum2-3.NTP. 22.214.171.124 2 u 5 64 357 68.795 -68.168 104.612 +europium.canoni 126.96.36.199 2 u 63 64 337 81.534 -67.968 92.792
Do share the tutorial if you find it useful. Cheers!