1831208 Members
3279 Online
110021 Solutions
New Discussion

ntp.conf query

 
SOLVED
Go to solution
Becke
Super Advisor

ntp.conf query


Hello Guys,

I have set up my prefered ntp server details in ntp.conf file, ie its ip address and dns entry.

now what do i do to sync the time on this hosts to an NTP server.

I get this error when I run ntpdate with -b and without -b option in order to sync the time with NTP server.

# ntpdate 10.209.28.250
7 Feb 10:25:13 ntpdate[712834]: the NTP socket is in use, exiting
# ntpdate -b 10.209.28.250
7 Feb 10:25:42 ntpdate[385194]: the NTP socket is in use, exiting

Please advise
Raf


9 REPLIES 9
Ivan Krastev
Honored Contributor
Solution

Re: ntp.conf query

First stop running xntpd process: /sbin/init.d/xntpd stop

force syncronization: ntpdate -b server

start xntp service: /sbin/init.d/xntpd start


regards,
ivan
James R. Ferguson
Acclaimed Contributor

Re: ntp.conf query

Hi Raf:

Ivan is correct, both 'xntpd' and 'ntpdate' use the same TCP port and hence cannot be run simultaneously.

That said, I would suggest that you configure NTP to set the server time to that of its time source(s) during bootup (by configuring the NTPDATE_SERVER variable in '/etc/rc.config.d/netdaemons') and thereafter let NTP run continuously.

Regards!

...JRF...
Becke
Super Advisor

Re: ntp.conf query


Thanks for your quick responses guys,

I have acutally tried stopping xntpd and then i have run the following but got an error ie
# ntpdate -b 10.209.28.250
7 Feb 15:16:45 ntpdate[217276]: no server suitable for synchronization found
###########################################
any suggestions?
James R. Ferguson
Acclaimed Contributor

Re: ntp.conf query

Hi Raf:

Use:

# ntpq -pn 10.209.28.250

...to troubleshoot. As asterisk ("*") in the leftmost column (before) the address indicates successful synchronization.

If you still get "no suitable server" see if:

# /usr/sbin/ntpdate -d 10.209.28.250

...offers any useful diagnostic information.

Regards!

...JRF...

Becke
Super Advisor

Re: ntp.conf query


Thanks James,

I'm not an expert with ntp:)

here is the error that i get with "ntpq -pn 10.209.24.250"
10.209.24.250: timed out, nothing received
***Request timed out
#########################################
Here is the debug info,you will notice that at the bottom it still complain that no server suitable for synchronization?

# ntpdate -d 10.209.24.250
7 Feb 16:00:30 ntpdate[503812]: 3.4y
transmit(10.209.24.250)
transmit(10.209.24.250)
transmit(10.209.24.250)
transmit(10.209.24.250)
transmit(10.209.24.250)
server 10.209.24.250, port 123
stratum 0, precision 0, leap 00, trust 000
refid [0.0.0.0], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Thu, Feb 7 2036 17:28:16.000
originate timestamp: 00000000.00000000 Thu, Feb 7 2036 17:28:16.000
transmit timestamp: c973db71.2c166000 Wed, Feb 7 2007 16:00:33.172
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000

7 Feb 16:00:34 ntpdate[503812]: no server suitable for synchronization found
#




Reshma Malusare
Trusted Contributor

Re: ntp.conf query

Hi Raf,
For NTP server.
Follow this :

1. modify /etc/rc.config.d/netdaemons
[ startup operation of NTP is controlled by netdaemons,If value is set to 1 then Xntpd will start at boot.You can start ths from command line by using
/etc/init.d/xntpd start]

2.modify /etc/TIMEZONE
[it must be remembered that the time zone setting on your system must be correct. For example if you are in the eastern daylight timezone, the /etc/TIMEZONE file must contain the EST5EDT time setting.]

3.modify /etc/ntp.conf
server navobs1.gatech.edu
server bitsy.mit.edu
peer gama
broadcast 192.168.2.255
driftfile /var/adm/ntp.drift
[The drift file is used to track the accuracy of the local clock over time. It is maintained by xntpd and used later to send fewer time synchronization requests to the server.
Some NTP servers may also require authentication from clients. In that case, the client machine maintains the /etc/ntp.keys file for this purpose]

4.Run /sbin/init.d/xntpd
5.WAit for NTP to establish associations with servers & peers.
6.Run ntpq -p to check associations.

Try ntpdate -b server server
-b--> Polls one or more servers ( NTP) & steps systemclock to synchronise the most accurate.
rick jones
Honored Contributor

Re: ntp.conf query

It sounds like you have a fundamental connectivity issue getting to your desired NTP servers - btw, you really SHOULD have multiple servers configured...

If you also cannot ping the NTP server's IP address, you may want to start looking into firewall issues along the path between your system(s) and the NTP server(s).

The output of netstat -rn might help us take some of the first steps along that path.
there is no rest for the wicked yet the virtuous have no pillows
BUPA IS
Respected Contributor

Re: ntp.conf query

Hello Raf ,
Since you are based in Australia you should try and use Australia's NMI (was part csio) time server which has recently changed address. They require you to register and may have advice on firewall settings for your circumstances. see this link

http://www.measurement.gov.au/index.cfm?event=object.showContent&objectID=9BD77455-BCD6-81AC-1BF1C5D980A48E4D

Mike
Help is out there always!!!!!
Becke
Super Advisor

Re: ntp.conf query


Thanks James , Bupa and Rick and all of those who responded.

I apologise for the late response as went on holidays and that was my last day when I posted my last message.

Actually you guys were right, I have found out that firewall/was rules were not there to allow ntp comunication, hence I did request the firewall team to place rules for ntp communication and the problem was resolved:)....I really appreciate everyone's help..