Operating System - HP-UX
1820595 Members
1416 Online
109626 Solutions
New Discussion юеВ

network time protocol(ntp)

 
Animesh Chakraborty
Honored Contributor

network time protocol(ntp)

Hi All,
I am facing difficulties in managing time with different servers as they are never in sync.so I want to implement NTP.can anyone help me how to configure NTP.is rebooting required ?

Thanks
Animesh
Did you take a backup?
8 REPLIES 8
Victor BERRIDGE
Honored Contributor

Re: network time protocol(ntp)

The simplest way is to use SAM:
SAM =>TIME=> NTP...
Alex Glennie
Honored Contributor

Re: network time protocol(ntp)

Following is a procedure to setup an NTP server using its local system clock
and any number of clients:


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.
Stefan Farrelly
Honored Contributor

Re: network time protocol(ntp)


No, you shouldnt need to reboot unless the time difference on the master NTP server is out by a large amount to a server youre trying to sync from.

The first thing you need to do is set up an NTP server - this is the one that other servers will sync to. You can either use sam or select your master NTP server and modify the /etc/ntp.conf file and create 2 lines;
server 127.127.1.1
broadcast
Now modify the entry in /etc/rc.config.d/netdaemons to autostart the xntpd daemon;
XNTPD=1
Now start the xntpd daemon; /sbin/init.d/xntpd start
Now you can use the following command to see that it is working;
ntpq -p
You should see an entry for your current server and an entry for LOCAL which shows that your server is sync'd to its local clock. Its now broadcasting so you can modify any other host to sync to this server by adding only 1 line to /etc/ntp.conf
server
and modify /etc/rc.config.d/netdaemons, same as above, and start the daemon, same again as above, and now the ntpq -p command will show your server syncing to the master server. It will show a + to signify its synced/syncing.
It may take some time to slowly synchronize the clocks, depending on how much different they are.

Also, there is a lot more to consider with ntp than the simple example I have above. You have to consider multiple master servers, peers (incase one goes down). There are a lot of configuration options for ntp which you should maybe to some research/reading up on (docs.hp.com) before you decide on an implementation.

Im from Palmerston North, New Zealand, but somehow ended up in London...
Rick Garland
Honored Contributor

Re: network time protocol(ntp)

Can use SAM or can manually modify the /etc/ntp.conf file. What is happening is you have at least one server (prefer two or more) going out to a stratum 1 server and they sync up. You now have a stratum 2 time server. All other systems sync to this stratum 2 server that you have on site.

In the /etc/ntp.conf file, you are defining which servers to look at for the ntp protocol. SAM is working much the same way.

There are numerous options with NTP, such as a driftfile, stats, etc.

More info at http://www.eecis.udel.edu/~ntp/ntpfaq

Animesh Chakraborty
Honored Contributor

Re: network time protocol(ntp)

Thanks a lot for all the inputs.
Now in case of breakdown of master server what will happen to the clients ?

Thanx
animesh
Did you take a backup?
Victor BERRIDGE
Honored Contributor

Re: network time protocol(ntp)

Nothing really,
But the best would be to have a backup server...
Rick Garland
Honored Contributor

Re: network time protocol(ntp)

If you have a breakdon of the master, good reason to have the clients pointing to at least two systems that are sync-ing to a stratum 1 server.

You can define more then one system for the clients to look at. This way, if an internal server goes down and the clients systems were looking at for NTP, they will also look at the addition server entry and sync to it.

Another senerio to look at, the stratum 1 server you sync with goes down. Use two or more stratum 1 servers to look at. The clients will look into your internal servers to sync with.

Example, 3 internal servers look to 2 different stratum 1 servers. One of the internal stratum 2 servers goes down. No worry, you have 2 other stratum 2 servers your internal systems can look to.

When you do the ntpq -p command, you will see it will sync to more than one server.

One catch however, if your network goes down and you cannot communicate outside...a single point of failure unless you become a stratum 1 site as well. Also, there is the LOCAL clock as well.
Anthony deRito
Respected Contributor

Re: network time protocol(ntp)

Keep in mind the option to perform "polling" or "broadcasting" on your NTP clients. There are pros and cons to each. I chose polling because I was concerned about network activity. Later I learned that the activity on the network is very minimal using NTP broadcasting.

Tony