Time Synchronisation with NTP in Ubuntu Server

Recently during some bug fixing, I found out that our database server’s time is 5 minutes off. First I thought probably the timezone was correct. Then I found out that for Ubuntu server you have to synchronisation the time. Every time server restarts, it update it’s time using ntpdate. You can do it using following code

ntpdate ntp.ubuntu.com

You can setup ntp, which will automatically update server’s time.

sudo apt-get install ntp

Then 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

You can update these server according to your time zone from http://www.pool.ntp.org/zone/@. After you changing the conf file, reload the ntp

sudo /etc/init.d/ntp reload

About Zakir Hyder

This entry was written by .

11. August 2014 by Zakir Hyder
Categories: Linux, Ubuntu | Tags: , , , , | Comments

Comments

  1. […] Recently during some bug fixing, I found out that our database server's time is 5 minutes off. First I thought probably the timezone was correct. Then I found out that for Ubuntu server you have to synchronisation the time. Every…  […]