NTP Client Error -- ntpstat shows unsynchronised
Hi All,
I am no expert in NTP But I have configured NTP Client many times, But this time something is going wrong. This is my /etc/ntp.conf Code:
[root@browser1 ~]# cat /etc/ntp.conf Code:
[root@browser1 ~]# cat /var/lib/ntp/drift Code:
[root@browser1 ~]# ntpq -p 10.2.29.26 Code:
Aug 23 11:13:11 browser1 ntpd: ntpd shutdown succeeded Other commands Code:
[root@browser1 ~]# /usr/sbin/ntpq -pn Am I missing something ? Please Help .!! If things does not work, I will have to put this in crontab. Code:
60 * * * * /usr/sbin/ntpdate -u 10.2.29.26 &>/dev/null |
Hi vikas027,
I'd have to guess a firewall issue, can you confirm 123/udp inbound to the client ? thanks, kbp |
Here's a known good ntp.conf that uses three pool servers (are you sure that 10.2.29.26 is serving time? That jitter value is way, way out of line) and does a fall-back to the local host when the network goes away for any reason. You can give this a try and see if it works for you; include 10.2.29.26 as your preferred source of time above the three pool servers and see if that helps. The ntp.conf below is well-commented to explain what's what in each section.
Your /etc/ntp directory should be owner and group root, mode 0755 and /etc/ntp/drift should be root.root and mode 0644; the ntp.keys file should be root.root and mode 600. Another thing is that if your system clock is too far off, NTP won't synchronize it -- try setting the clock with ntpdate and one of the pool servers (just in case 10.2.29.26 isn't serving you, then start the daemon. Hope this helps some. Code:
# |
Quote:
here it is Code:
[root@browser1 ~]# netstat -an | grep 123 |
Quote:
Quote:
Code:
[root@browser1 ~]# ls -ld /etc/ntp Code:
[root@browser1 ~]# ntpstat |
Have you tried starting ntpd with logging so you can see what's what?
Something like Code:
>/tmp/ntp.log Again, that jitter time looks like your NTP server is not serving time to you; are you sure it's running, that it's configured to serve time and that you can get from "this" system to it (like, can you ping it?). "Good" log entries will look something like (I use three pool servers, yours will be different) Code:
23 Aug 08:50:33 ntpd[2919]: logging to file /tmp/ntp.log |
Hi vikas027,
Running a netstat only shows that it is listening, not that the ntp server can communicate with the ntp client cheers, kbp |
hi vikash
may be your server config is not correct.some day back i have also faced this issue. Pl post your server config by viewing i will suggest some thing. Either you can change with this conf. server ur time server server 127.127.1.0 fudge 127.127.1.0 stratum 10 before doing all this activity stop your ntpd service and after config client run ntpdate -u time server ip.for three times. may be it works..... bye |
Quote:
Are you asking for this, Code:
[root@browser1 ~]# ntpq -p 10.2.29.26 |
Quote:
I ran the above commands and found this in /tmp/ntp.log. Code:
6 Sep 08:54:25 ntpd[4650]: logging to file /tmp/ntp.log And yes, I am able to ping it. Code:
[root@browser1 ~]# ping 10.2.29.26 |
Back in the prehistory of the world with NTP I recall having to initialize /etc/ntp/drift with a real number; e.g.,
Code:
log in as root or su - Looking up at your initial post, you have your driftfile defined as /var/lib/ntp/drift? The log is telling you that it's looking in /etc/ntp/drift (and it's maybe looking for other file in /etc/ntp too? You may want to just try changing your server section in /etc/ntp.conf to something like this Code:
server 127.127.1.0 # local clock Comment out the authenticate line; it's not doing anything. You're looking for keys, does the file /etc/ntp/keys exist and is there anything in it? I don't use keys and the provided example file (/etc/ntp/ntp.keys) contains Code:
65535 M akey Code:
# Then stop and restart the daemon and see what the log tells you. I have this in the daemon start up; you may want to add the logging to yours. Code:
# Start/stop/restart ntpd. |
Thanks a tronayne for your time. I have done the changes as told by you.
My new ntp.conf is Code:
[root@browser1 ~]# cat /etc/ntp.conf Code:
[root@browser1 ~]# cat /etc/ntp/drift All lines are commented in keys Code:
[root@browser1 ~]# cat /etc/ntp/keys New, log file Code:
8 Sep 01:35:30 ntpd[22438]: logging to file /tmp/ntp.log |
You know, the messages about port 123 look like they might be an indication of your problem -- seems like it's telling you that port 123 is in use (by who knows what). If you take a look-see at /etc/services there may be something there; e.g.,
Code:
grep 123 /etc/services It could also be that NTP is already running when you try to start it (make sure to shut it down first) or it's getting started twice or some other weird thing. Check around in your daemon start scripts to make sure that there aren't two daemons getting launched; I don't know what Red Hat uses for starting daemons (init.d, rcn.d or what) but try searching the tree in /etc for any instances of ntpd. Something like Code:
cd /etc For what it's worth, my system (yours may be different) turns up these files: Code:
cd /etc It just looks like there may be double entries somewhere in the start-up or something else has grabbed port 123 (and no other daemons should be accessing that port, it's meant for NTP). Too, take a look at the output of ps; Code:
ps -ef | grep ntp Hope this helps some. |
Finally, solved !!
You were absolutely right there were many ntp processes running. I killed them all.
Now, after running the below commands, I waited for around 5 mins. Code:
>/tmp/ntp.log Code:
[root@browser1 ~]# cat /tmp/ntp.log Code:
[root@browser1 ~]# cat /etc/ntp/drift Code:
[root@browser1 ~]# ntpstat Code:
[root@browser1 ~]# cat /etc/ntp.conf Just one more small question, just for sake of knowledge:- In /tmp/ntp.log it is showing as synchronized to stratum 1 while in ntpstat output, it is showing stratum 2. What is this stratum and why it is showing differently (stratum 1 and stratum 2) |
A server operating at stratum 1 belongs to the class of best NTP servers available, because it has a reference clock attached to it. As accurate reference clocks are expensive, only rather few of these servers are publically available.
A stratum 1 server should not only have a precise and well-maintained and calibrated reference clock, but also should be highly available as other systems may rely on its time service. Maybe that's the reason why not every NTP server with a reference clock is publically available. |
Quote:
But why it is showing differently (stratum 1 and stratum 2) ? (Pls see my previous post, where I have shown all data) |
Glad to know you got it going -- one last thing, though...
See if you can find the actual start-up, shut-down script in the initialization directories in /etc. It may be located in /etc/rc.d, /etc/rcn.d, /etc/init.d or some such (it's the file that is executed at boot and shutdown). If you ever need to fiddle with /etc/ntp.conf again, execute that file (as root) with a "stop" or "restart" argument (that will kill the currently running NTP daemon. You may want to edit the logging into that file (/tmp/ntp.log won't get that large and if there's a problem it's a convenient place to look for what's what). Makes life a little easier. Glad you got it going. |
Quote:
But why it is showing differently (stratum 1 and stratum 2) ? (Pls see my previous post, where I have shown all data) I am asking this just for sake of knowledge. |
There's a pretty concise explanation of stratum 0, stratum 1 and stratum 2 servers at http://www.endruntechnologies.com/stratum1.htm. There's also a pretty good article at http://en.wikipedia.org/wiki/Network_Time_Protocol; everything worth knowing about NTP.
It looks like the server you're using as a time source is a stratum 1 server (your system, by default, is stratum 2). |
I have a similar issue
I have same ntp issue on Xenserver
18 Feb 22:05:10 ntpd[16431]: logging to file /tmp/ntp.log 18 Feb 22:05:10 ntpd[16431]: precision = 1.000 usec 18 Feb 22:05:10 ntpd[16431]: ntp_io: estimated max descriptors: 1024, initial so cket boundary: 16 18 Feb 22:05:10 ntpd[16431]: Listening on interface wildcard, 0.0.0.0#123 Disabl ed 18 Feb 22:05:10 ntpd[16431]: Listening on interface lo, 127.0.0.1#123 Enabled 18 Feb 22:05:10 ntpd[16431]: Listening on interface xenbr0, 192.168.10.7#123 Ena bled 18 Feb 22:05:10 ntpd[16431]: Listening on interface xenbr3, 192.168.10.7#123 Ena bled 18 Feb 22:05:10 ntpd[16431]: kernel time sync status 0040 18 Feb 22:05:10 ntpd[16431]: getaddrinfo: "::1" invalid host address, ignored 18 Feb 22:05:10 ntpd[16431]: frequency initialized 0.000 PPM from /var/lib/ntp/d rift This is Xenserver's ntp.conf file looks like # 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 Xen's public servers. #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. server127.127.1.0# local clock fudge127.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 # Specify the key identifier to use with the ntpq utility. #controlkey 8 server 64.90.182.55 server 0.pool.ntp.org server 1.pool.ntp.org server 2.pool.ntp.org I do not understand what is the "::1" mean in error log Can anybody help me? Thank you very much. |
Hi newych,
I do not know much about your error. But could you please try the below configuration. Remove your old file and just use these 4 lines in your ntp.conf Code:
server 64.90.182.55 prefer Code:
echo "0.0" > /etc/ntp/drift Verify, after waiting for around 5 mins by ntpq -pn and post your output here. |
Hi vikas027,
After run ntpq -pn 64.90.182.55, i got following result: ntpq -pn 64.90.182.55 remote refid st t when poll reach delay offset jitter ============================================================================== *127.127.1.0 .ACTS. 0 l 17 64 377 0.000 0.000 0.000 Below is my /tmp/ntp.log Shutting down ntpd: [ OK ] 22 Feb 11:52:48 ntpd[25034]: logging to file /tmp/ntp.log 22 Feb 11:52:48 ntpd[25034]: precision = 1.000 usec 22 Feb 11:52:48 ntpd[25034]: ntp_io: estimated max descriptors: 1024, initial so cket boundary: 16 22 Feb 11:52:48 ntpd[25034]: Listening on interface wildcard, 0.0.0.0#123 Disabl ed 22 Feb 11:52:48 ntpd[25034]: Listening on interface lo, 127.0.0.1#123 Enabled 22 Feb 11:52:48 ntpd[25034]: Listening on interface xapi2, 192.168.10.7#123 Enab led 22 Feb 11:52:48 ntpd[25034]: kernel time sync status 0040 " unknown, line ignored034]: configure: keyword "prefer I also have this issue posted on Citrix forums at: http://forums.citrix.com/thread.jspa?threadID=258940 From page 2 to the end. It will tell you what i did in the last few days, |
My issue is resolved. It was caused by enable "Auto Dos" on my HP Procurve 1810G. When i disable "Auto Dos", ntpd service start without any issue. Thanks for your help.
|
ntp service not syncing properly
once again i have same issue..i have try almost everything mention here in this post please help me now how can i solve this issue with your help..
thanks |
All times are GMT -5. The time now is 06:22 PM. |