7

I have a small LAN that has no connection to the internet. It consists of two ubuntu servers clustered together providing NFS services to two IP cameras.

I need to synchronize the time on all the equipment. The Cameras support NTP so my plan was to run NTP on the server cluster.

Can I configure NTPD to just use the system time until this project gets funding to add a 3G/4G connection?

This is actually going to be harder than I thought. I'm running a heartbeat cluster with DRBD. I'm going to need to have my primary server provide NTP to the two IP cameras and the other server in the cluster. If my primary server fails I need the secondary server to take over the NTP time server.

What do you guys suggest I do here??

Matthew
  • 204
  • 6
  • 15

3 Answers3

7

Your best-bet is to create a time cluster. A set of three (or more) systems, configured with peer associations. The cluster will negotiate a common consensus of time and should defend against clock-drift on all of them. It won't be truly accurate, for that you'll need a radio clock like you already know.

peer 192.168.62.4
peer 192.168.62.12
sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • 1
    I just found a section in my book that says I can reference the local hardware clock. I would add the line "server 127.127.1.1" in the ntp.conf file. I'll take what you said into consideration though! – Matthew Oct 22 '12 at 16:33
  • 1
    @Matthew You'll need to do that to get reference clocks on each, but having three in a peer-group should help keep clock drift from getting *too* far out of true. – sysadmin1138 Oct 22 '12 at 16:49
  • 6
    Actually I'd say the *best* bet is to buy a cheap GPS and set up a proper NTP service using that as a reference. This would be the second best (and cheaper) option :-) – voretaq7 Oct 22 '12 at 16:54
  • You may prefer to pick one clock and set that as a lower stratum than the others. Otherwise, each machine may just prefer its own clock and no actual synchronization will take place. – David Schwartz Oct 22 '12 at 18:03
  • Voretaq I completely agree, but my boss is serious about this budget. Soon one of our IP cameras will have a GPS and I can use that camera as a NTP server. It's not very redundant but it will make them happy. anyway I'll make sure of that sysadmin1138! – Matthew Oct 22 '12 at 19:08
  • I'm reading up on peering right now! – Matthew Oct 22 '12 at 19:51
  • So here is my ntp.conf file on both servers http://pastebin.com/KKjf67UH... EMserver1 is the my primary. I'm rather exhausted so thanks everyone for the help! – Matthew Oct 22 '12 at 20:27
  • Due to the way that the NTP algorithm works, there is no guarantee that this will actually keep the time in sync. Adding a GPS as voretaq7 suggested is really the only sensible choice. I hear Opengear have some small, simple embedded devices that might work for this... – Paul Gear Oct 23 '12 at 21:59
5

If you're offline but want actual time, connecting any run-of-the-mill GPS receiver to your systems will keep time synched to within a second. You'll notice a relatively high jitter, but you'll keep regular time.

For some effort on your part, acquiring a GPS with a pulse-per-second feature will provide fantastic time keeping. In particular, the Garmin 18x LVC can be purchased for under $65. For the effort of giving it a 5 volt power supply and a serial port on the bare wires, you can have an accurate time keeping system for a very low impact on the budget.

There are plenty of tutorials on this subject if you search for "Garmin 18x NTP" or some other variation.

Jeff Ferland
  • 20,547
  • 2
  • 62
  • 85
-1

To add to all the above check out http://css-timemachines.com/ - they have a $299 minimum features NTP server. If you add that to the peering suggestion above you would have to spend a whole pile of money to get only a fraction better!

dezldog
  • 29
  • 2