Re: single ntp server for 3 setups (258 Views)
Reply
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 1 of 5 (280 Views)
Accepted Solution

single ntp server for 3 setups

[ Edited ]

Hi ,

 

I have to configure a single ntp server for 3 of my setups in different networks.

 

such that if it goes down , the other server must be able to take it over , and even if that one fails it must take time from own local server.

 

i have googled and found the following ;

 

Hi,
please find the Local NTP server and NTP Client Configuration procedure as below,

Server Side Configuration:
**************************
Open the below file and modify the below lines as below,
vi /etc/rc.config.d/netdaemons

export INETD=1

NTPDATE_SERVER=
export XNTPD=1
export XNTPD_ARGS=

Now open below file and modify,

# vi /etc/ntp.conf

server 127.127.1.1
fudge 127.127.1.1 stratum=10
broadcast

now start the ntp service.

# /sbin/init.d/xntpd start

check the status that server is synchronizing locally through below command.

#ntpq -p

 

Now my question is wha ideally can act as a good ntp server ?

 

 

P.S. This thread has been moved from HP-UX>System Administration to HP-UX > networking- HP Forums Moderator

Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 5 (267 Views)

Re: single ntp server for 3 setups

> Now my question is wha ideally can act as a good ntp server ?

 

A computer connected to an atomic clock that is maintained by a person with a Ph.D. in Metrology :-)

 

But if a computer has a free serial port, you can get reasonably close to that ideal economically, by plugging a NMEA-0183-compatible GPS module to that serial port and ensuring that the antenna of the GPS module has a good view of the sky. Each GPS satellite includes a very good atomic clock and is constantly broadcasting the time.
The xntpd daemon includes a generic driver for NMEA-0183-compatible GPSs.

MK
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 3 of 5 (258 Views)

Re: single ntp server for 3 setups

Hi Matti ,

 

Thanks for that explaination.

 

But say if i have 3 different locations ( hp + aix servers )  kept in respective Data center ;

i want all of them to be in sync.

 

We connect to these three locations from a noc . 

I need to configure the following

 

  1. windows box ( ntp server ) in NOC who would be in sync thru internet , which will inturn sync windows boxes kept in 3 different locations respectively.
  2. If main NOC box fails , the windows box at respective locations should be in sync..
  3. If 3 windows box also fail then , time should be taken from self system clock.

 

I hope m clear now.

Can this be achieved ?

Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 4 of 5 (254 Views)

Re: single ntp server for 3 setups

You asked for an "ideal" solution and you got it :-)

 

The solution for your problem might be as easy as listing all your NTP servers in the ntp.conf file.

Xntpd will automatically figure out what is the "best" source of time information, by measuring network round-trip delays and looking at the stratum values of each server.

(Background: a NTP server that gets its time directly from an atomic clock, a GPS receiver or equivalent reliable timesource has stratum 1. All the NTP clients and peers that get their time from syncing with that server will have stratum 2. Each subsequent link in the synchronization chain will increment the stratum value. In principle, the xntpd will pick the server that has the lowest stratum value, unless it has awful network connectivity to that server, or several other servers indicate a significantly different time.)

 

The question is: do you want the HP/AIX box you are configuring to act as a NTP server for other hosts or not?

If not, you won't need the "server 127.127.1.1" line (and its associated "fudge..." line) at all: the system will always fall back to the local clock when other sources are not available. As a bonus, if you use the "driftfile" keyword, xntpd will calculate the average system clock error and will automatically apply the correction while xntpd is running, even if no other servers are reachable. This will minimize the local clock error even if all NTP access is temporarily lost.

 

The "server 127.127.1.1" line only allows xntpd to serve the local system clock time to other NTP clients and peers: if it is not used, the system clock time is used locally, but not announced with the NTP protocol to any other system. The "fudge..." line tells what stratum value xntpd should announce when it is relying on the local system clock for time information.

 

Assuming that you want this HP/AIX box to act as a broadcast NTP server for all local systems on its network segment, your ntp.conf might look like this:

driftfile /var/ntp/drift
server <NOCWindowsBox> prefer server <otherWindowsBox1> server <otherWindowsBox2> server <otherWindowsBox3> server 127.127.1.1 fudge 127.127.1.1 stratum=10 broadcast

 Your three conditions would be satisfied like this:

1.) the Windows box at NOC should normally have the highest stratum, so it should be automatically the preferred time source. The "prefer" keyword is just an extra hint to xntpd that syncing with this server would be preferable over the others.

2.) You might just as well list all the other Windows NTP servers to enable xntpd to make cross-checks between the returned time values. If these get their time from the NOC, they should each have identical stratum value, so xntpd will pick the closest of these if the NOC server is not accessible. But if the local Windows box reports a wildly different time from the other servers (and the local system clock) compared to other reachable Windows NTP boxes, xntpd will label it as a "falseticker" and will attempt to maintain sync with one of the others.

3.) if none of the other time servers are reachable, the "server 127.127.1.1" will allow this server to continue NTP broadcasting using its local system clock only. 

MK
Super Advisor
zxcv
Posts: 226
Registered: ‎04-09-2010
Message 5 of 5 (231 Views)

Re: single ntp server for 3 setups

Thanks Matti.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.