2

I have 2 servers set with the same timezone and I set them with the same time and I have them both updating their server time from the same internet time source.

But each week they seem to fall away from each other time wise, one will always end up about 30 seconds out of sync from the other.

Why does this happen and how can I prevent it?

Slee
  • 141
  • 2
  • 7
  • possible duplicate of [Best way to synchronise the time on a Windows 2008 Server](http://serverfault.com/questions/4298/best-way-to-synchronise-the-time-on-a-windows-2008-server) – Tom O'Connor Aug 30 '12 at 15:08

1 Answers1

3

This happens because of many many reasons (most likely, different quality crystals/capacitors in rtc chips and/or different temperatures,...). 30s per week is alot, but that could be 15s per week for each server in different directions (one too slow, one too fast).

To prevent this, configure ntp to sync the time to an external timeserver. If you cannot connect outside, you can set up a ntp server on one of them and sync the other with it. Their clocks will be both wrong, but still synchronized.

mulaz
  • 10,682
  • 1
  • 31
  • 37
  • thanks for the clarification - I guess I need to have it sync every night, I am kinda of dependent on these 2 times matching – Slee Aug 30 '12 at 15:23
  • Slee, you wouldn't have it sync every night, it would constantly be in sync. NTP constantly compares itself to the upstream servers and makes adjustments so that time is accurate. – Kyle Smith Aug 30 '12 at 15:54
  • @KyleSmith, you're wrong, that would kill pool.ntp.org if that were the case. It's on a schedule, to adjust look at something like http://www.pretentiousname.com/timesync/index.html. – Alex Berry Aug 30 '12 at 16:38
  • 1
    @Slee, are these servers virtual machines? If so they will need a piece of software that keeps time in sync with the hypervisor, and have the hypervisor sync to the NTP server. This is a very common occurence in virtual machines as it is difficult to emulate an accurate RTC, the VMs rely on clock cycles to maintain their time. – Alex Berry Aug 30 '12 at 16:40
  • @AlexBerry they are indeed virtual machines, Rackspace Cloud Servers. Is there a particular piece of software you know of? – Slee Aug 30 '12 at 23:59
  • 1
    It really depends on the hypervisor underneath it, if you can find out what it is then you should be able to find what software you need, for instance if it's VMWare you'll need to install VMWare tools. – Alex Berry Aug 31 '12 at 07:47
  • @AlexBerry: No. `ntpd` is a [daemon](https://en.wikipedia.org/wiki/Daemon_%28computing%29) that will run continuously and talk to the upstream servers as needed. – Martin Schröder Aug 31 '12 at 16:53