Saturday, 10 January 2009
Setting up NTP on Debian
Introduction
What is NTP? It is a UDP protocol for correcting system clocks.
Why am I using it? I've got a couple of Debian based machines running on VMWare, and the clock keeps going out of sync. I want to have as little overhead on these boxes as possible, so I set up an NTP Daemon on the VMWare host, and then the NTP Clients on the VMWare Guests.
My Sources
I followed this guide, but it was a little unclear, so I figured I'd follow it up and add my notes to the mix.
Setting up the server
Firstly, I had to get the NTPd running on the server. The Host machine is running Debian, but if you aren't, then provided you can install an NTP server on the server, you'll be OK.
I installed ntpdate and ntp from the Debian repositories using the following apt command:
Next, use the date command to ensure the clock is closer to being in sync.
If you've got a local NTP server, you should edit the file /etc/ntp.conf and either add to the server lines (if you also want to keep access to the existing pool of NTP servers) or comment out the existing server lines.
Add your server in the format (where the server's IP address is 111.222.333.444): Start the NTP daemon using the command:
Essentially, the steps here are exactly the same as with the server, except, where you point all of your NTP sources at a common IP address for the host machine.
What is NTP? It is a UDP protocol for correcting system clocks.
Why am I using it? I've got a couple of Debian based machines running on VMWare, and the clock keeps going out of sync. I want to have as little overhead on these boxes as possible, so I set up an NTP Daemon on the VMWare host, and then the NTP Clients on the VMWare Guests.
My Sources
I followed this guide, but it was a little unclear, so I figured I'd follow it up and add my notes to the mix.
Setting up the server
Firstly, I had to get the NTPd running on the server. The Host machine is running Debian, but if you aren't, then provided you can install an NTP server on the server, you'll be OK.
I installed ntpdate and ntp from the Debian repositories using the following apt command:
apt-get install ntp ntpdateNext, I stopped the NTPd using this command:
/etc/init.d/ntp stopI then ran the ntpdate command (which won't run while the ntpd is running) to bring the clock into sync with the upstream server:
ntpdate pool.ntp.orgIf you've got a more local NTP server, use that in place of the pool.ntp.org.
Next, use the date command to ensure the clock is closer to being in sync.
server 111.222.333.444
/etc/init.d/ntp startFinally, type the following command:
ntpq -pThis may take a few moments, but should return some sort of text like the following:
remote refid st t when poll reach delay offset jitterSetting up the clients
==============================================================================
11.111.11.11 222.222.2.222 2 u 21 64 377 0.603 65.748 7.470
Essentially, the steps here are exactly the same as with the server, except, where you point all of your NTP sources at a common IP address for the host machine.
Labels: explanation, Hints and Tips, Linux, Migrated From Trac Wiki, NTP
Subscribe to Posts [Atom]