Operating System - HP-UX
1753915 Members
8448 Online
108810 Solutions
New Discussion

How to set ntp service using scripts or sam?

 
renki
New Member

How to set ntp service using scripts or sam?

Hello to all!
There are 2 HP ia64 hosts in a cluster.Now I want to synchronize the two hosts' time.I haved tried to configure the ntp service as follow:
host1(server):
1. vi/etc/ntp.conf
add
server 127.127.1.1
2. vi/etc/rc.config.d/netdaemons
change
export NTPDATE_SERVER=127.127.1.1
export XNTPD=1
3. start xntpd
/sbin/init.d/xntpd start
host2(client):
1. create file /etc/ntp.drift
2. vi/etc/ntp.conf
add
server 127.127.1.1
driftfile /etc/ntp.drift
3. vi/etc/rc.config.d/netdaemons
change
export XNTPD=1
4. start xntpd
/sbin/init.d/xntpd start
but when I excuted the command $date at the same time on the two hosts ,the result ware
Wed Sep 13 14:45:48 EAT 2006
Wed Sep 13 14:47:16 EAT 2006
Why the time on the two hosts is not the same?
The steps are right? What about the right approaches?
6 REPLIES 6
Jannik
Honored Contributor

Re: How to set ntp service using scripts or sam?

It will change the time slowly.
What does "ntpq -p" give you?
jaton
Bill Hassell
Honored Contributor

Re: How to set ntp service using scripts or sam?

Since these machines are in a cluster, I would expect that accurate time is important, especially if data on this cluster will be shyared with other computers. Using one machine to sync with another will mean both machines be the same but they will drift all over the map as computer clocks are notoriously inaccurate. Any data center should have a central NTP server that is synced to multiple Internet clocks and ensures that all systems are within a few milliseconds of world time. Your network administrator probably setup your firewall and routers to be NTP servers. I would point all your systems to this type of server.


Bill Hassell, sysadmin
rick jones
Honored Contributor

Re: How to set ntp service using scripts or sam?

IIRC all 127.X.Y.Z addresses are loopback? I might be wrong there. Anyhow, that being the case, you would need to have either host1 take time from host2's IP, or host2 from host1's IP. If indeed 127.127.1.1 is not a loopback IP then consider this another of my "Emily Litella" moments :)

Bill's suggestion to sync to some external time source(s) ( you should have more than one) is quite good. That or you might consider getting some GPS clocks to connect to your systems.

I would think that the ServiceGuard docs would be all over configuring time synchronization for a cluster.
there is no rest for the wicked yet the virtuous have no pillows
Adisuria Wangsadinata_1
Honored Contributor

Re: How to set ntp service using scripts or sam?

Hi Renki,

Good day to you !
Perhaps the document below can help you to setup the NTP ('How do I configure a local NTP server?', docID : KBRC00015667) :

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000081573208

OR this document below ('How can I setup NTP without using SAM?', docID : UOTHKBAN00000796
) :

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062686582

Hope this information can help.

Cheers,
AW
now working, next not working ... that's unix
florin_10
Frequent Advisor

Re: How to set ntp service using scripts or sam?

Hi Renki,

On the client;
vi /etc/ntp.conf add the
vi /etc/rc.config.d/netdaemons add
NTPDATE_SERVER=
XNTPD=1
XNTPD_ARGS=
check/create driff file /etc/ntp.drift
server master_clockserver

On the master_clockserver check if the ntp daemon is running ok; /usr/sbin/ntpq -p
the /etc/ntp.conf has server=127.127.1.1

Cheers
fl
doug hosking
Esteemed Contributor

Re: How to set ntp service using scripts or sam?

And since this question is in the Ignite-UX section, I wonder if you might want to know that an IUX config file can have lines like

ntpdate_server="15.x.y.z"

that, according to instl_adm(4) will set up the configuration for you, assuming that IP address 15.x.y.z is an existing NTP server.

" [final] ntpdate_server = cplx_string
Sets the network time protocol server that the client uses to
keep the clock synchronized. See ntpdate(1M) for details. This
is currently not used during the installation, rather after the
client is finished installing.
"