1838279 Members
3356 Online
110125 Solutions
New Discussion

time slow by 8 minutes

 
M.Thomas
Frequent Advisor

time slow by 8 minutes

we run ntp on our servers and i noticed one server was slow by 8 minutes. can i run /sbin/init.d/xntpd start while i have apps up on this production box to sync the time?

Thanks

Thomas
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: time slow by 8 minutes

Hi Thomas:

Running 'xntpd' (NTP) on your servers is the only sane thing to do.

However, if your server is 8-minutes behind the correct time, NTP is going to take an "eternity" to adjust the time.

Since you are *slow*, set the clock ahead with 'date' and implement NTP. Stepping time forward is acceptable. Stepping time backwards can lead to problems in logging and particularly with database transations.

Regards!

...JRF...
Christian Tremblay
Trusted Contributor

Re: time slow by 8 minutes

Yes you can, then time will slowly adjust.
But you should investigate why the daemon was down in the first place.

Chris
Victor BERRIDGE
Honored Contributor

Re: time slow by 8 minutes

Hi,
I never had trouble putting the time right on a server that is slow..., I would set the time then /sbin/init.d/xntpd start...
Its not the same as having servers that are fast...


All the best
Victor
James R. Ferguson
Acclaimed Contributor

Re: time slow by 8 minutes

Hi (again) Thomas:

I would add, that it is useful to configure '/etc/rc.config.d/netdaemons' with NTPDATE_SERVER=. This runs 'ntpdate' once to step the clock to the correct time during boot-up. Thereafter, 'xntpd' runs (if configured) to maintain accurate timekeeping.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: time slow by 8 minutes

> can i run /sbin/init.d/xntpd start while i have apps up on this production box to sync the time?

No No!! The startup script for xntpd assumes that this is a reboot and therefore will jump the time instantly to the correct time! Assuming you have a valid /etc/ntp.conf file, you would run ntpdate -B NTPserver_IPaddr (note: capital B) to slowly slew the time by maintaining the same number of seconds per day but run the clock slightly faster. 8 mins will take about 3 hours or so to be within a few seconds.

Check every hour or so after starting ntpdate -B NTPserver_IPaddr and once the time is within a few seconds, then you can kill ntpdate and just run xntpd (not the startup script).


Bill Hassell, sysadmin
M.Thomas
Frequent Advisor

Re: time slow by 8 minutes

can i run this ntpdate -B of a server in our network which has the correct time? rather than the one mentioned in the ntp.conf file?

Thanks

Thomas
Keith Johnson
Valued Contributor

Re: time slow by 8 minutes

If that server is set up to "share" time you can. To check, use the ntpq command like ntpq -p
No matter where you go...there you are.
Bill Thorsteinson
Honored Contributor

Re: time slow by 8 minutes

You may want to peer each server to a couple
of the other servers. This will help keep
them in sync. One server should have its
clock configured as a time source and fudged
to a high stratum, usually 10 or 12.
This will be your backup time source if
you loose your external time source(s).

Jumping forward shouldn't cause running
services any problems.

Generally, I set one or three servers to use
the same external time sources. Again one
or three different sources. Often you can use
your ISP's DNS server(s) as a time source.

I then configure all other servers to
refer to the server(s) with the external
time source(s).

A rouge low priority time source can really
cause you problems. NTP works best with
an odd number of sources.
rick jones
Honored Contributor

Re: time slow by 8 minutes

I wholeheartedly concurr with the suggestion to configure multiple sources of time serving. Better still would be to buy some add-on GPS or WWVB receivers and make your own stratum 1 server(s) - but you would still want multiple time sources configured as a backup.

Just be sure that the time sources you use are willing to serve time to you - not just that they respond to the NTP queries, but that you've also gotten the OK from their admins.

Bill's suggestion to use the slow slew of ntpdate is the most solid/conservative suggestion and least likely to upset your apps. It may be "belt and suspenders" depending on your apps, but sometimes "belt and suspenders" is goodness.
there is no rest for the wicked yet the virtuous have no pillows