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. |
All times are GMT -5. The time now is 09:33 PM. |