1753937 Members
10045 Online
108811 Solutions
New Discussion юеВ

Re: ntp time diff

 
SOLVED
Go to solution
Rasheed Tamton
Honored Contributor

ntp time diff

I have a test server and its time is around 5 minutes behind the actual time and none cared before. Now we want to make it on the production env. I setup the NTP on this server to sync with the NTP server which has GSP and the time does not change. It still shows the old time.

-I added the NTP server name in the ntp.conf file
-created the drift file (empty file)
-started the ntpd daemon

What might be the problem?

Do I have to run, ntpdate or anyother steps missing. Please advise.

Thanks
Rasheed.
8 REPLIES 8
Isralyn Manalac_1
Regular Advisor

Re: ntp time diff

Hi Rasheed,

Here are the steps to configure NTP:


Procedure on the main server:

Log in as root and run a SAM session then do the following steps:

1. Click on the Time icon.

2. Click on the NTP Network Time Sources icon.

3. Select the menu Action -> Configure NTP Local Clock

4. Select Use System Clock and press OK

5. Select the menu List -> NTP Broadcasting

6. Select the menu Action -> Add Broadcast Client Network

7. Enter the broadcast address of the subnet where your client is located. You
can get this information by running the following command on the client:

ifconfig lan0 ---> you will get the following listed:

lan0: flags=863
inet 15.37.113.130 netmask fffff800 broadcast 15.37.119.255


Here's the broadcast address

So add the broadcast address of all your clients if they are not on the same
subnet.

8. Select the menu Action -> Start NTP
Your server is now set.


Procedure for the client:

Log in as root and run a SAM session, then do the following steps:

1. Click on the Time icon.

2. Click on the NTP Network Time Sources icon.

3. Select the NTP Broadcasting icon.

4. Select the menu Actions -> Enable Receiving Time Broadcasts

5. Select the menu Actions -> Start NTP
Your client is now set. You can repeat this on all your clients.

Regards,

Ira
Henk Geurts
Esteemed Contributor

Re: ntp time diff

hi Rasheed

what does
# ntpq
ntpq> peers

show ?

a helpfull link here :
http://docsrv.sco.com/NET_tcpip/CTOC-ntpN.ntp.html

regards.
Alex Lavrov.
Honored Contributor

Re: ntp time diff

Yes, you should run ntpdate to sync with ntp server.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Bill Hassell
Honored Contributor
Solution

Re: ntp time diff

Actually, it is not a good idea to run ntpdate to immediately (jump) sync your server. Database systems are often time-dependent and suddently changing the time can create big problems. Although it is a test server, you should get in the habit of first using ntpq to verify functionality as well as looking in syslog.log for NTP errors. Start with the command:

/usr/sbin/ntpq -p

which reports on all the NTP servers you are using. If they are reporting "reach" values of 0 or other errors, you need to fix the NTP communication first.

Once ntpq -p starts showing 'normal' values (reach = 377) then the time will begin to change. 5 minutes will need more than an hour to sync completely. Now if you configured /etc/rc.config.d/netdaemons to specify your default NTP server and set the XNTPD otption =1, then a reboot will set the clock immediately, but only if ntpq -p is working.


Bill Hassell, sysadmin
Charles Holland
Trusted Contributor

Re: ntp time diff

Rasheed,
Is this still open? First impresssion is that you have done everything required. I'd still like to see what your response is to Bill's inquiry. If you have started xntpd you should be able to get some kind of response. Also nptq -p is "Print a list of the peers known to the server as well as a summary of their state." so you should be getting something.

You modified your ntp.conf file specifing a server that you have apprently been using. Specified a drift file location, and then ran "/sbin/init.d/xntpd start" you should be getting something after 10-15 minutes.

As Bill said you would have to change the /etc/rc.config.d/netdaemons file so that xntpd starts up at boot time. After that, it should be working. NTP will take a few minutes to report anything as it is not "instantaneous".

Regards
"Not everything that can be counted counts, and not everything that counts can be counted" A. Einstein
rick jones
Honored Contributor

Re: ntp time diff

I was under the impression that IP addresses should be what go into the /etc/ntp.conf file.

In addition to the advice about checking reachability with ntpq, you might also check syslog. I believe that the maximum delta is > five minutes, but there is a time differnece above which xntpd will not try to sync time on the premis that manual intervention would be best.

Also, don't forget that when it does sync the time, it will do so rather slowly - it will not (generally) alter the time in one swell foop (stepwise adjustment) but will rather change the rate at which the clock advances to gradually bring it into agreement with the time source (slew).

Finally, just as one should have multiple DNS servers, one should configure multiple NTP time sources.
there is no rest for the wicked yet the virtuous have no pillows
Charles Holland
Trusted Contributor

Re: ntp time diff

Rick
I have the following entries in my ntp.conf file on one system

server 192.5.41.41 # Stratum 1: tock.usno.navy.mil
server time-c.timefreq.bldrdoc.gov

and

server 192.5.41.40 # Stratum 1: tick.usno.navy.mil
server time-a.timefreq.bldrdoc.gov

in another..... both working fine.

A time difference > 5 minutes may be correct, I thought it was 10 minutes, but I may be wrong. So before xntp might start working a manual adjustment of time may be required. The idea of checking the syslog may shead some light on what is going on, or not going on as the case may be.

Rasheed
You might also find something at

http://ntp.isc.org/bin/view/Support/WebHome

Rasheed... how about some feed back. If you have it now working, suggestions can quit being made.

Regards

"Not everything that can be counted counts, and not everything that counts can be counted" A. Einstein
Charles Holland
Trusted Contributor

Re: ntp time diff

Rick found this entry...

However, if the difference between the client time and server time is greater than the panic threshold, which defaults to 1000 s, the daemon sends a message to the system log and shuts down without setting the clock. It is necessary to set the local clock to within the panic threshold first, either manually by eyeball and wristwatch and the Unix date command.

at

http://www.eecis.udel.edu/~mills/ntp/html/debug.html
"Not everything that can be counted counts, and not everything that counts can be counted" A. Einstein