LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-10-2014, 02:18 PM   #1
claforce
LQ Newbie
 
Registered: Jun 2014
Posts: 17

Rep: Reputation: Disabled
ntp offset stays at about 19 minutes


Hello,
I'm trying to resolve an issue I have on one of our servers where the ntp offset is at 1113 second or about 19 minutes. Right now it is showing 2:32PM when it is really 2:14PM. The server has the same ntp.conf as other servers in the same subnet which are not having issues, and ntpd is setup in chkconfig and is running. This is a CentOS 5.8 server.

Code:
# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*4.53.160.75     204.9.54.119     2 u   15   64  377    6.840  -111338   0.463
+69.164.204.77   66.228.59.187    3 u    3   64  377   21.044  -111338   0.302
+50.7.64.4       147.231.2.6      2 u   26   64  377   33.878  -111338   0.279
 127.127.1.0     .LOCL.          10 l    9   64  377    0.000    0.000   0.001

# ntpdate -b time.nist.gov
10 Sep 14:24:53 ntpdate[20451]: step time server 128.138.141.172 offset -1113.385469 sec
I've even tried to force a change, but the time will not upudate.

Code:
# ntpd -gq
ntpd: time set -1113.391540s
or
Code:
#sntp -r time.nist.gov
The time correction is -1113.401 +/- 0.000+0.026 seconds
Do you want to correct the time anyway? y
Here is my currently /etc/ntp.conf

Code:
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org

#broadcast 192.168.1.255 key 42         # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 key 42             # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 key 42  # manycast client

# 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
fudge   127.127.1.0 stratum 10

# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8
Please let me know if you can offer any assistance.
Thanks,

Chris.
 
Old 09-10-2014, 02:45 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,797

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Offset is too big to be ajusted by ntpd.

try:
Code:
/usr/sbin/ntpdate 0.rhel.pool.ntp.org
Then ntpd should work

[edit]
Sorry, did not read carefully enough, you already tried that (even without -b ?) :/

Maybe you have to stop ntpd service before running ntpdate, then restart ntpd

Last edited by keefaz; 09-10-2014 at 02:55 PM.
 
Old 09-10-2014, 03:11 PM   #3
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Commenting this section out will help prevent future large time offsets:
Code:
# 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
fudge   127.127.1.0 stratum 10
Otherwise you have to use 'ntpdate' or 'ntpd -q' to set it if there is a large offset.
 
Old 09-10-2014, 04:02 PM   #4
claforce
LQ Newbie
 
Registered: Jun 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
metaschima,
I commented out this section and ran "ntpd -q", but it does not update my time.


Code:
# ntpd -gq
ntpd: time set -1113.379110s
Code:
# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 4.53.160.75     .STEP.          16 u    -   64    0    0.000    0.000   0.000
*time1.scl3.mozi .GPS.            1 u   23   64  377   55.966  -111337   0.337
 triangle.kansas .STEP.          16 u    -   64    0    0.000    0.000   0.000
Thanks,

Chris.
 
Old 09-11-2014, 09:09 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,797

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
Did you try to stop ntpd, update time, then start ntpd ?
 
Old 09-11-2014, 09:53 AM   #6
claforce
LQ Newbie
 
Registered: Jun 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
keefaz,
Yes I did stop ntpd before I tried to update the time and then I restarted it when complete.

Thanks,

Chris.
 
Old 09-11-2014, 10:38 AM   #7
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Can you try changing the time manually using date and hwclock ?
 
Old 09-11-2014, 11:04 AM   #8
claforce
LQ Newbie
 
Registered: Jun 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
It appears I cannot set the time manually either. Is this an issue with hwclock?

Code:
#hwclock --show
Cannot access the Hardware Clock via any known method.

# date -s "11 SEP 2014 10:49:00"
Thu Sep 11 10:49:00 CDT 2014

# date
Thu Sep 11 11:07:34 CDT 2014
 
Old 09-11-2014, 12:10 PM   #9
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Are you running a custom kernel ? Make sure the RTC is enabled in the kernel, otherwise you cannot set the time from the OS, only from BIOS.
 
Old 09-11-2014, 12:20 PM   #10
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,797

Rep: Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943Reputation: 943
yup, also rtc error should show up in dmesg
 
Old 09-11-2014, 03:08 PM   #11
claforce
LQ Newbie
 
Registered: Jun 2014
Posts: 17

Original Poster
Rep: Reputation: Disabled
So it appears that RTC must not have been built into the kernel:

Code:
# dmesg | grep rtc
rtc: IRQ 8 is not free.
Looks like it's a xen kernel

Code:
$ uname -a
Linux 2.6.18-194.11.4.el5xen #1 SMP Fri Sep 17 05:17
 
  


Reply

Tags
centos, ntp, ntpd, time


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTP offset tony359 Linux - Server 27 11-25-2013 03:30 PM
NTP offset LittleMaster Linux - Server 3 05-27-2013 05:33 AM
NTP offset issue rhythm4urs Linux - Server 5 05-19-2012 01:47 AM
NTP high offset noir911 Red Hat 1 01-22-2009 08:34 AM
NTP offset marstse Linux - General 1 01-14-2009 12:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration