1834447 Members
2407 Online
110067 Solutions
New Discussion

configure ntp.conf

 
masooda
Occasional Advisor

configure ntp.conf

Hi I am new bee in ntp.conf configuration.
The story unfolds here...
"Server 1" shows the correct time.
"Server 2" 's time is 20 lagging..or in other way I can say the second server's time is incorrect.

Then I do some investigation on the second server..
$ /usr/sbin/ntpq -p
/usr/sbin/ntpq: read: Can't assign requested address

The I found that xntpd is not running.The I did /sbin/init.d/xntpd start
then...
# /usr/sbin/ntpq -p
No association ID's returned

Once the xntpd daemon started then we executed /usr/sbin/ntpq -p again and we got this output:

$/usr/sbin/ntpq -p
No association ID's returned

Then we visited /etc/ntp.conf
Here we found that all the lines in the file are commented out.
We found that all the entries are commented out in /etc/ntp.conf

etc $ grep -v "^#" ntp.conf|grep -v "^$"
etc $

Then we visited the "server 1" which shows the correct time...
We visited /etc/ntp.conf file and found that there are only two uncommented lines:

# grep -v "^#" ntp.conf|grep -v "^$"
driftfile /etc/ntp.drift # path for drift file
server 192.6.144.34
#

Now I have been told that The NTP timesource on server 1 is a valid source, so I should try to use that one.

Now do I need to enter those two lines in /etc/ntp.conf from server 1 into the server 2 .. please suggest.



6 REPLIES 6
Jeeshan
Honored Contributor

Re: configure ntp.conf

yes, without server name and drift ntp won't work.

and keep in mind, after starting ntp, it requires some time to sync. so you can verify that the server is syncing using

#ntpdate

a warrior never quits
masooda
Occasional Advisor

Re: configure ntp.conf

Now I got a sad news.. I told you that NTP source in the server 1 is valid. And I also told you that I am gonna use server 1's NTP source IP in server 2's ntp.conf file.

The IP present in the ntp.conf of server 1 is not pingable from server 2.

In this case I think I need to find some other 'valid' ntp time source which can be 'pinged' from server 2.

Am I correct..?
Jeeshan
Honored Contributor

Re: configure ntp.conf

yes, you can
a warrior never quits
masooda
Occasional Advisor

Re: configure ntp.conf

The server 2 still shows the wrong time ..
On server 2
init.d $ /usr/sbin/ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
192.6.144.34 0.0.0.0 16 - - 64 0 0.00 0.000 16000.0
init.d $



on server 1 ..with correct time:

# /usr/sbin/ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
*atlosd1.osdatl. tor-ntp.omc.hp. 3 u 59 64 367 1.16 -0.179 0.09
#



I have a question her...trying to be optimistic... if the server2 is not able to ping it's ntp source IP (in ntp.conf)..then is it compulsory that I should keep an IP which is pingable?
Bill Hassell
Honored Contributor

Re: configure ntp.conf

Although ping is generally a good indication of connectivity, many, many network administrators will block ping and extreme situations, all ports may be blocked by routers until authorized. So your search for a valid NTP source must start with the network administrators to see if there is an NTP server built into the routers. You can verify connectivity for port 123 (NTP port) using ntpq -p and specify the IP address. Until that command returns the NTP server information, you won't be able to get NTP working.


Bill Hassell, sysadmin
Rasheed Tamton
Honored Contributor

Re: configure ntp.conf

Hi,

If you have communication issue with the master NTP server you could do the server one has the NTP server for the server 2.

By this method, the server 1 will sync the time with 192.6.144.34 and server 2 will sync the time with server1.