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:
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:
restrict default nomodify notrap noquery
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
Also edit your /etc/ntp/step-tickers file and REPLACE the contents with:
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
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.
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.