What is NTP? It is a UDP protocol for correcting system clocks.
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.
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
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 ntpdate</pre>Next, I stopped the NTPd using this command:<pre>/etc/init.d/ntp stop</pre>I then ran the ntpdate command (which won't run while the ntpd is running) to bring the clock into sync with the upstream server:<pre>ntpdate pool.ntp.org</pre>If you've got a more local NTP server, use that in place of the pool.ntp.org. <br /><br />Next, use the date command to ensure the clock is closer to being in sync.<br /><br /><div class="blogPost"><li>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.</li><br /><li>Add your server in the format (where the server's IP address is 111.222.333.444):<pre>server 111.222.333.444</pre></li>Start the NTP daemon using the command:<pre>/etc/init.d/ntp start</pre>Finally, type the following command:<pre>ntpq -p</pre>This may take a few moments, but should return some sort of text like the following:<pre> remote refid st t when poll reach delay offset jitter<br />==============================================================================<br /> 184.108.40.206 220.127.116.11 2 u 21 64 377 0.603 65.748 7.470<br />
Setting up the clients
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