Categorized | News

Keeping in Time with ntp

Posted on 22 December 2003 by Demian Turner

The default time-synching service in Linux is not enabled by default nor is it particularly easy to configure on Redhat.  If you’re running any time-based applications however you’ll quickly realise how important it is to have your server reporting the correct time.

To get things up and running with the minimum fuss I would recommend you backup your default ntp config file and use these setting in /etc/ntp.conf:

server     ntp2.mcc.ac.uk prefer

server     127.127.1.0   # local clock
fudge      127.127.1.0   stratum 10

driftfile  /etc/ntp/drift

authenticate     no

The server listed, ntp2.mcc.ac.uk, is a free server hosted by Cambridge university you can connect to without authentication – this is set to the preferred connection.

The driftfile keeps track of how many seconds off your local time was off, and authentication is set to off in this case.

Once you’ve edited the /etc/ntp.conf file, start or restart the ntp daemon with

$ /etc/init.d/ntpd start

then you can check the results with

$ ntpq -p

It will take 3-4 mins to kick in, if your jitter value is 4000 that means it hasn’t worked, also confirm by checking your server’s local time with a

$ date

For more details see this tutorial.

Bookmark and Share

Leave a Reply

Categories

Books

Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists

Facebook