LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ntp drifting on one server (https://www.linuxquestions.org/questions/linux-newbie-8/ntp-drifting-on-one-server-755107/)

mfischman 09-14-2009 12:12 PM

ntp drifting on one server
 
One of our SLES servers has an issue where time drifts ahead until the ntp process dies. Running 'ntpdate 10.10.10.10' syncs it up again and '/etc/init.d/ntp start' gets the process running again but within a few hours or so the time creeps forward until the process dies.

In the log file /var/log/ntp I see we regularly get the following error:

no servers reachable

Then, after between 10 and 14 minutes it is able to contact a server but then it gets the following sanity check error:

4 Sep 09:40:45 ntpd[30856]: time correction of -1552 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time.

Running '/etc/init.d/ntp status' shows the ntp process is now dead.

Has anyone seen this or knows what is happening and how to fix? Thanks.

Mike

michaelk 09-14-2009 12:45 PM

What are you using for time servers? Post that section of the ntp.conf file.

Is ntp actually syncing up to a timer server? Post the output of the command:
ntpq -p

The * tells you this is the connected server.

http://networking.ringofsaturn.com/Protocols/ntp.php

mfischman 09-14-2009 01:42 PM

Thanks for the help.

SLES100:~ # ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+fs1.mydomain XX.XX.XX.XX 2 u 138 1024 377 0.001 24.667 1.929
*fs2.mydomain XX.XX.XX.XX 2 u 186 1024 377 0.001 -10.013 3.260
fs3.mydomain XX.XX.XX.XX 3 u 68 1024 377 1.341 18.028 3.754
+fs4.mydomain XX.XX.XX.XX 2 u 65 1024 377 0.001 -20.906 16.462


SLES100:~ # cat /etc/ntp.conf
################################################################################
## /etc/ntp.conf
##
## Sample NTP configuration file.
## See package 'ntp-doc' for documentation, Mini-HOWTO and FAQ.
## Copyright (c) 1998 S.u.S.E. GmbH Fuerth, Germany.
##
## Author: Michael Andres, <ma@suse.de>
##
################################################################################

##
## Radio and modem clocks by convention have addresses in the
## form 127.127.t.u, where t is the clock type and u is a unit
## number in the range 0-3.
##
## Most of these clocks require support in the form of a
## serial port or special bus peripheral. The particular
## device is normally specified by adding a soft link
## /dev/device-u to the particular hardware device involved,
## where u correspond to the unit number above.
##
## Generic DCF77 clock on serial port (Conrad DCF77)
## Address: 127.127.8.u
## Serial Port: /dev/refclock-u
##
## (create soft link /dev/refclock-0 to the particular ttyS?)
##
# server 127.127.8.0 mode 5 prefer

##
## Undisciplined Local Clock. This is a fake driver intended for backup
## and when no outside source of synchronized time is available.
##
#server 127.127.1.0
# local clock (LCL)
#fudge 127.127.1.0 stratum 10
# LCL is unsynchronized

##
## Outside source of synchronized time
##
## server xx.xx.xx.xx # IP address of server

##
## Miscellaneous stuff
##

driftfile /var/lib/ntp/drift/ntp.drift
# path for drift file

logfile /var/log/ntp
server XX.XX.XX.XX
server XX.XX.XX.XX
server XX.XX.XX.XX
server XX.XX.XX.XX
# alternate log file
# logconfig =syncstatus + sysevents
# logconfig =all

# statsdir /tmp/ # directory for statistics files
# filegen peerstats file peerstats type day enable
# filegen loopstats file loopstats type day enable
# filegen clockstats file clockstats type day enable

#
# Authentication stuff
#
# keys /etc/ntp.keys # path for keys file
# trustedkey 1 2 3 4 5 6 14 15 # define trusted keys
# requestkey 15 # key (7) for accessing server variables
# controlkey 15 # key (6) for accessing server variables

michaelk 09-14-2009 03:18 PM

I assume you are using local time servers?
Enabling the local server (commenting the lines for the fake server) should keep ntp from dying. At this moment everything looks good. Difficult to determine where the problem lies but without ntp running how fast does the clock drift?

Is this a virtual server?

mfischman 09-14-2009 03:28 PM

NTP dies after about four hours.

Our servers point to a few internal time servers which in turn point to time sources on the internet.

michaelk 09-14-2009 04:54 PM

Look for any process that could be hogging cpu time.
Is this a recent problem? What changes have you made recently to this server.


All times are GMT -5. The time now is 06:32 PM.