Operating System - HP-UX
1753970 Members
7429 Online
108811 Solutions
New Discussion юеВ

Syncronize time using NTP

 
SOLVED
Go to solution
Tan-Phu Lu_1
Occasional Contributor

Syncronize time using NTP

I'm trying to syncronize my servers (HPUX 10.20 and 11) but it dosn't work. Time is still difference.
I setup an NTP server (Started NTP, Added my broadcast Clients, Authentication disable, Receiving time broadcasts Disable, NTP local clock with system clock).
All my six NTP clients setup are: Started NTP, Receiving time broadcasts Enable, NTP local clock with no clock.
All the setup is done by SAM.
Have any idea? Do I need a reboot for all my servers? Is there any delay? ....
Thx.
tpl
6 REPLIES 6
Michael F. Dick
Advisor

Re: Syncronize time using NTP

Hi,

no, you don't need to reboot (since ntp runs as a deamon). Why are you using broadcast ??. do the setup with using one station (the one with the local clock) as the master, and the other stations would be client (in this case, the time egts pushed from the master to the clients.

To your question...what is ntpq saying (can you see the master ??, did they try to sync ??, did you build the ntp or did you use a binary distribution ??). there is alot (of little things) who can go wrong with ntp. Other than that read the stuff on www.eecis.udel.edu/~ntp/.
Well, thats all just my $.02
Rita C Workman
Honored Contributor
Solution

Re: Syncronize time using NTP

OK..here's a little method you can use to sync the time on all your servers. I am using one of my servers as the timekeeper that all the rest sync to...They are a combination of 10.2 and 11.

On the server you want to be the master clock.
Edit /etc/rc.config.d/netdaemons
export NTP_SERVER=
XNTPD=1
export XNTP_ARGS=

Edit /etc/ntp.conf
At end of file add the following:
server 127.127.1.1
fudge 127.127.1.1 stratum 10

Now on all other servers you want to sync their time:
Edit /etc/rc.config.d/netdaemons
export NTP_SERVER=
XNTPD=1
export XNTP_ARGS=

Edit /etc/ntp.conf
At the end of file at the following:
server=
driftfile /etc/ntp.drift

touch /etc/ntp.drift

NOW....go back to your masterclock server and make sure your time is set to what you want it....then:
/sbin/init.d/xntpd stop
/sbin/init.d/xntpd start

And do this on all your other servers...
Then check after a few minutes to see if your time sync'ing ntpq -p

Regards,
James R. Ferguson
Acclaimed Contributor

Re: Syncronize time using NTP

Hi:

The suggestion made already to use /usr/sbin/ntpq to help diagnose your problem. I find this tool extremely helpful.

If the time difference between your servers is 1000 seconds or greater, xntpd will ignore the servers time. If a client cannot find a server to which to synchronize in about 320 seconds, the xntpd daemon will die. Therefore, check the time differences when you startup and manually adjust them if necessary, first. Once ntpq shows an association it will still take some time for the server and client to come to a common time. Be patient. Here again, ntpq is invaluable.

...JRF...
Tan-Phu Lu_1
Occasional Contributor

Re: Syncronize time using NTP

Thank to all specially Rita your suggestion works very well. To other users, please don't use SAM to setup NTP.
tpl
Bill Hassell
Honored Contributor

Re: Syncronize time using NTP

I would start by testing your time source with ntpq -p time_server to see if it responds. If all is well, configure ntp.conf and setup xntpd to run automatically.

Just a note about changing the time as a large step: databases won't be very happy. As a result, the ntpdate command has a new option -B which slews the time slowly, about 50ms per second. Run this prior to starting xntpd and wait until the clock is accurate.

ntpdate is called at boot time to make a step change before any user processes are run, so if you can reboot, you won't have to wait for ntpdate -B to slew the clock.


Bill Hassell, sysadmin
Bill P. Fanelli
Honored Contributor

Re: Syncronize time using NTP

Thank you HP for these new features on date mechanisms. Several years ago, I had a time server reset to zero and start telling all the devices that would ask that it was January 1, 1970! At the time, all the asking servers just believed it, reset their clocks and went merrily along.

In the post-mortem, we all felt that there should be a reasonableness test on time correction. Thanks for adding it.

BPF
Manage by rules, not by lists.