Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep time in sync among servers without internet connection

Tags:

clock

ntp

I have 5 servers on a LAN without Internet connection. I need them to keep the clock in sync among them.

I could configure them as NTP peers, and set a high stratum for the local clock of one of them. In this way, the other four would sync with that clock.

What I actually want, is them to agree on a time using all of the 5 local clocks (i.e. doing some kind of average), for reasons of robustness and precision. Is it possible with NTP?

PS: I do not want to use an external clock source.

EDIT: and no scripting outside NTP features, that could only make precision worse :)

like image 769
cavedon Avatar asked Jun 25 '10 22:06

cavedon


People also ask

How do I sync my time without internet?

GPS is the typical solution for machines that need time sync but have no external network connectivity. There are various software applications, both free and commercial, that can use a GPS receiver to sync the system time (search for "gps windows time sync" and you'll find a number of them).

Can NTP work without internet?

In other words, without an Internet connection. That system runs 10 computers, 9 of which are slaves as far as NTP is concerned and these computers must have their clocked set as close as possible to the controller's clock or the system won't work as expected.

Is time synchronization needed within a network?

The Importance of Time Synchronization for Your Network In modern computer networks, time synchronization is critical because every aspect of managing, securing, planning, and debugging a network involves determining when events happen. Time also provides the only frame of reference between all devices on the network.


2 Answers

If you average 5 drifting clocks, the only thing you get is another drifting clock that's harder to correct. It won't be more precise. NTP uses multiple servers to increase precision because it takes network latency into account. Since all your systems are on a fast local network, you just need one server.

Set up two systems to be NTP server, one a primary, and if you feel the need, one a backup. Have all other systems synchronize to them. This will be significantly easier to set up than the clock-averaging solution, and you won't have to develop any crazy scripts.

like image 195
Karmastan Avatar answered Oct 14 '22 20:10

Karmastan


You might be able to have one of them listen for the times from each computer, perform an average, set the average as it's own time, and broadcast that time for all the other computers. It seems a little excessive, though.

like image 35
Computerish Avatar answered Oct 14 '22 19:10

Computerish