NTP Pool project logoMost probably you have already seen the clock of a computer differing from another. Although it may not be a big problem for your alarm clock on your smartphone, for a server, lacking synchronization could impact some of your services and if the gap is too big with others computers, could even impact your mails being sent correctly, or others critical applications.
But in fact, it’s quite easy to avoid that.
All you need to do is to install NTP to sync with the pool of available NTP servers.
What is NTP
The Network Time Protocol (NTP) is a protocol designed to synchronize your local time clocks with networked time servers. A pool of NTP servers is being set up in a hierarchical manner and allow any use to enter in the pool.
The hierarchy is separated into different levels, the most accurate level being the Stratum 0, reserved for atomic clocks. The next level, Stratum 1 is used by machines locally connected to the Stratum 0 clocks, etc… The others level (Up to 15) are also ranked by the accuracy of their clocks.
And once being synchronize, you could also being a NTP server to spread the right clock time worldwide ! Start to feel like a conquistador? 🙂 It would be more like helping to share the load in fact…. (Don’t be disappointed)
Let’s install NTP:
sudo apt-get install ntp
ntp will act both client and server (If you wish too)
Well that’s all in fact….for most of the users, the default configuration will be enough. But if you want, you could select the servers you want to sync to.
If you want to see on which NTP server you are connected to, simply type:
to add/modify servers to synch with, modify the /etc/ntp.conf file:
sudo nano /etc/ntp.conf
and change the list of servers to sync with. (You could create a pool of servers that are close to your area). A good list could be find on the NTP Project.
If you do want to add servers, don’t simply add a second one, but at least 3 or 4 to improve accuracy as the Segal’s law states:
A man with a watch knows what time it is. A man with two watches is never sure.
Also, adding at the end of the server name the option “iburst” will push NTP to sync with this server in priority right after starting up. (Instead of waiting few minutes)
server 0.europe.pool.ntp.org iburst
but only few of you should use this option as it adds load to the pool for probably unnecessary reasons. (I don’t use it)
Restart NTP to take into account your modification:
sudo /etc/init.d/ntp restart
Join the NTP Pool
NTP Project are always looking for more volunteer to run a NTP node and help share the load. But it should be a long term commitment as once you in the pool, although it is easy to be removed from, it may takes months before inbound request stop.
Here is the servers list as of the date of this post. As you can see, Africa, South America and Asia have haven’t a broad coverage.
NTP project recommend some settings that would be good to follow before to apply for joining the NTP Pool.
If you are all set, simply create an account and add your server to your account in their Manage Servers page.
It will take a certain moment for your node to be listed and really used as NTP Project will first assess the reliability of your server. You will need to obtain a score of 10 to be listed. You can see where you stand through the Manage Servers page.
Time machineYou should now have your server synchronized with the rest of the world and hopefully helping to stay that way with your NTP server 😉