1834127 Members
2039 Online
110064 Solutions
New Discussion

Time synchronisation

 
SOLVED
Go to solution
ramesh_4
Occasional Advisor

Time synchronisation

I have four HP Servers which has the same time zone set. But the time is not the same with four servers. One is reading 9:3324, second is reading 9:333:26. third is reading 9:33:56, and fourth is reading 9:33:10. How to synchronize the time between all the four servers? Can anyone help me out?
like to find out new things and compare with other flavours of unix
7 REPLIES 7
Philip Chan_1
Respected Contributor
Solution

Re: Time synchronisation

Ramesh,

You can synchronize the time clocks of all your servers through xntpd (Network Time Protocol daemon).

Say, your servers are named A, B, C, D. And server A will be the master server such that server B, C and D will synchronize to it.

Steps,

- to server A, create the file /etc/ntp.conf containing one single line "server 127.127.1.1"

- to server B, C and D, create the file /etc/ntp.conf containing one single line "server A version 3" /* replace "A" with your hostname */

- to server A, B, C and D, edit the file /etc/rc.config.d/netdaemons, change XNTPD to "1".

- you'll have to reboot all your servers for that to take effect, OR, run /sbin/init.d/xntpd instead.

One reminder is that if your server times are too far off from the master, xntpd may refuse to synchronize the time. If this is the case you'll have to manually adjust the times close enough (perhaps 1 to 2 minutes behind) to the master server for them to start with.

Hope this help.

Rgds,
Philip
Thierry Poels_1
Honored Contributor

Re: Time synchronisation

Hi,
check Time in Sam:
setup NTP broadcasting on one (or more) server(s)
and define this server as the NTP source on the other servers

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Steven Sim Kok Leong
Honored Contributor

Re: Time synchronisation

Hi,

The more effective method is using NTP (network time protocol). Out of the 4 servers, you need to assign one as the NTP server and the rest as the NTP clients.

You can man xntpd for more details.

Alternatively, you have to rlogin or remsh to each client from a control server to update the time on each client at periodic intervals.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Printaporn_1
Esteemed Contributor

Re: Time synchronisation

Hi
you can configure NTP by.

1. Choose one of server as a time server.
2. at all client add
server
to /etc/ntp.conf
3. all server and client that want to sync time
set XNTPD=1 in /etc/rc.config.d/netdaemons

reboot and hope this help.
enjoy any little thing in my life
Karthik_2
Regular Advisor

Re: Time synchronisation

Ramesh,
Another idea would be to synchronise your time with one fo the internet time servers if your servers are connected to the
internet.This will give you accurate timing in all servers.
Refer man ntp for more info .

Cheers
Karthik...
Its ALL in the MATRIX
Steven Sim Kok Leong
Honored Contributor

Re: Time synchronisation

Hi,

For security reasons, it is safer to synchronize with your own NTP time servers (which you have more control over) rather than other time servers across the Internet.

If someone compromises any of the NTP time servers and either fast forward or rewind the time backwards, it may cause the NTP clients especially database servers to perform erratically. Database servers are most sensitive to time changes, especially if the time is tuned backwards.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
rick jones
Honored Contributor

Re: Time synchronisation

the point about NTP server compromise is an interesting one. I wonder though if it is as much of a wory if one were to define say three or more time servers. If someone compromised one of them, before long, it would probably (cannot say with certainty) be caught by the "false ticker" logic in the NTP daemon.

another reason I suppose why one should always configure several sources of time and not just one time server.
there is no rest for the wicked yet the virtuous have no pillows