hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Hosting Security and Technology Tutorials : HOW-TO: use NTP to keep your system clock accurate to one thousandth of a second
Reply

Hosting Security and Technology Tutorials Tutorials related to server security or the like.
Forum Jump

HOW-TO: use NTP to keep your system clock accurate to one thousandth of a second

Reply Post New Thread In Hosting Security and Technology Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-07-2004, 04:31 PM
Doggy Doggy is offline
Disabled
 
Join Date: Oct 2003
Location: Portugal
Posts: 62

HOW-TO: use NTP to keep your system clock accurate to one thousandth of a second


There is a wonderful net standard called NTP that can synchronize system clocks. You may already have followed someone's advice and used 'ntpdate' or 'rdate' to set the time on your server. But NTP is really designed to keep a large network of clocks perfectly synchronized. Not just accurate to the second, but to the millisecond! Here's how to set it up.

First, make sure you have some kind of firewall running. This is generic information really, not specific to NTP, but you should always run a firewall if you have a publically available server. In this case, it may protect you from yet-undiscovered flaws in your NTP client.

Now to properly use NTP, you need to have the full set of NTP tools. You may already have them installed; you can check by running the following as root:

rpm -q ntp

If it says it is not installed, then you need to download and install the appropriate RPMs. Head over to http://www.rpmfind.net/linux/rpm2htm....php?query=ntp and find the right package for your operating system. Download the RPM, and install it as root:

rpm -ivh ntp-*.rpm


Now, you have to configure it. I've done all the hard work and found some reliable servers with open access policies ... all you have to do is copy my files!

You need to edit your /etc/ntp.conf file and REPLACE the contents with the following:

PHP Code:
restrict default nomodify notrap noquery
restrict 127.0.0.1
server now
.okstate.edu
server clock
.nyc.he.net
server clock
.via.net
server ntp
-2.vt.edu
server  127.127.1.0     
# local clock
fudge   127.127.1.0 stratum 10
driftfile 
/etc/ntp/drift 
Also edit your /etc/ntp/step-tickers file and REPLACE the contents with:

PHP Code:
now.okstate.edu
clock
.nyc.he.net
clock
.via.net
ntp
-2.vt.edu 

Now run the following:

chkconfig --level 345 ntpd on
service ntpd restart


And you're all done! The ntpd program is running in the background, accurately keeping time down to the millisecond, with absolutely no drift. Your clock will always be accurate!

Reply With Quote


Sponsored Links
  #2  
Old 06-28-2004, 10:29 PM
wilhil wilhil is offline
WHT Addict
 
Join Date: May 2004
Posts: 118
not good enough. I want mine close to one millionth of a second!

only joking but couldnt resist saying it!

thanks for this thread, i know about the time feature, but wanted to learn more info on it.

Reply With Quote
  #3  
Old 07-10-2004, 03:27 PM
dunia dunia is offline
Newbie
 
Join Date: Jul 2004
Location: Italy
Posts: 5
implemented except for...

chkconfig --level 345 ntpd on
service ntpd restart

commands not found....

suppose it will start on next system startup the same as already preconfigured as remmed...

thanks for the info
c.klemp

Reply With Quote
Sponsored Links
  #4  
Old 07-13-2004, 07:36 AM
naguib2000 naguib2000 is offline
Junior Guru Wannabe
 
Join Date: May 2004
Posts: 62
if i may ask

what is the purpose of letting your time accurate . what would i loose if its not ???

Reply With Quote
  #5  
Old 07-13-2004, 09:40 AM
Angel78 Angel78 is offline
Registered User
 
Join Date: Jan 2001
Location: Vienna, Austria
Posts: 2,530
dead will rise from their graves and sun will disapper for the next 23 years.




Nothing, you will just have non accurate system clock

Reply With Quote
  #6  
Old 08-28-2004, 03:51 PM
Sevoma973 Sevoma973 is offline
Temporarily Suspended
 
Join Date: Aug 2004
Posts: 47
Thanks Doggy forthis information, I have used it on my server because I use a lot of cron jobs and want to keep the time acurate.

Reply With Quote
  #7  
Old 04-08-2005, 05:40 AM
VisiGod VisiGod is offline
Junior Guru Wannabe
 
Join Date: Jun 2003
Location: Portugal
Posts: 30
Just a quick notice, you can use pool.ntp.org to fetch random servers instead of pointing to single hosts. Check ntp.org for more informations. I have it working on my network and it works like a charm

Reply With Quote
  #8  
Old 04-21-2005, 03:51 PM
jonathanjab jonathanjab is offline
Junior Guru Wannabe
 
Join Date: Mar 2005
Location: Cardiff, Wales, UK
Posts: 45
Quote:
Originally posted by naguib2000
if i may ask

what is the purpose of letting your time accurate . what would i loose if its not ???
In a single-server enviroment where there is only one clock it's not so important, but when you start sharing files across servers, use more than one server to host a site (i.e. server farm or primary/fallover), or have separate subsystems for mail/database, etc. it becomes quite important.

Reply With Quote
  #9  
Old 04-29-2005, 11:28 AM
blueface blueface is offline
Web Hosting Guru
 
Join Date: Oct 2004
Posts: 299
Quote:
Originally posted by VisiGod
Just a quick notice, you can use pool.ntp.org to fetch random servers instead of pointing to single hosts. Check ntp.org for more informations. I have it working on my network and it works like a charm
Thanks for the tips! I usually use the ntp.nasa.gov server and it's been rock solid.

Reply With Quote
  #10  
Old 05-21-2005, 04:52 PM
Cyberpunk Cyberpunk is offline
Web Hosting Evangelist
 
Join Date: Feb 2001
Location: UK
Posts: 458
Centos?

I looked at the download options for the tools but I couldnt see an option for centos, can it be done for this os?

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
WorldHostingDays / MegaUpload clarification Blog 2012-03-27 13:45:23
Web Host Layered Technologies Offers Compliance Guarantee Web Hosting News 2012-02-17 14:32:11
Web Host 1&1 Enhances Dedicated Server Line with 32 Core, 64 GB RAM Server Web Hosting News 2011-12-20 15:30:05
SingleOS Launches Fuscan Linux Cloud 2.0 Web Hosting News 2011-08-12 19:09:05
UK Web Host Krystal Extends Services at The Bunker Data Center Web Hosting News 2011-06-24 20:34:06


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?