Operating System - HP-UX
1833325 Members
2870 Online
110051 Solutions
New Discussion

NTP time needs to be adjusted

 
SOLVED
Go to solution
Mark Nierth
Advisor

NTP time needs to be adjusted

I've got 4 HP servers running 11.0 that use NTP. One of these servers is the NTP server. All four are running about 10 minutes slow. Rather that waiting until Sunday when the DB's come down, is there a safe way to slew the time. I've read the man pages on ntpdate with the -B options but not sure of the steps.
5 REPLIES 5
Patrick Wallek
Honored Contributor
Solution

Re: NTP time needs to be adjusted

You could try using the date command on the NTP server with the '-a' option.

# date -a 600

will slowly adjust the time forward 600 seconds. While your NTP server is being adjusted, your clients should be as well.
A. Clay Stephenson
Acclaimed Contributor

Re: NTP time needs to be adjusted

Your fundamental problem is that you have only 1 NTP server; that is a no-no. You really need multiple time sources (Internet time sources are fine; if you are 10 minutes off GPS sources are overkill). I would simply issue a date -a 600 command of each box and they will slew together (more or less).

After you do this; you really need to get more reliable time souces to feed NTP. Even Internet time sourses will keep you stable typically to within a few tens of milliseconds and often much better.
A Mickey Mouse watch will keep better time than most servers; unfortunately Mickey doesn't come with a data port.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: NTP time needs to be adjusted

If you use ntpdate, you'll need to stop xntpd:

/sbin/init.d/xntpd stop

(that prevents conflicts between ntpdate and xntpd). Then run ntpdate -B (NOTE: unpatched versions of ntpdate do not have the -B option--which is NOT the same as -b, do not make the mistake of using -b as it will instantly change the time) and the server name as in:

/usr/sbin/ntpdate -B your_NTP_servername

You can then watch the time with the date command. 10 minutes will take about 3 hours to get within a few seconds. Once the time is within a few seconds, you can kill ntpdate if it is still running and then start xntpd again. The ntpdate -B option will shrink or expand each time tick slightly so the exact number of seconds per hour remains the same but will move the clock as needed. That way, databases will be unaffected.


Bill Hassell, sysadmin
Mark Nierth
Advisor

Re: NTP time needs to be adjusted

Thanks Patrick, that did the trick.

Clay, the network folks suggested that I use one/two of their Cisco routers as the NTP source. Any comments?
Bill Hassell
Honored Contributor

Re: NTP time needs to be adjusted

Most modern firewall/routers have the ability to become an NTP server. Your network administrator will need to configure the firewall to use 3 to 5 NTP sources on the Internet. Once completed, your entire company can reference this source as the NTP server. This is the concept of stratum levels in the NTP protocol. Note that the accuracy for multiple levels is not degraded. You'll still get 128ms sync accuracy.


Bill Hassell, sysadmin