-2

Let's say I have two different Servers located in same DataCenter. But when I check the date on both, there are a few second difference between them.

Example:

[root@server1 ~] # date
Tue Feb 23 11:40:22 SGT 2016

[root@server2 ~] # date
Tue Feb 23 11:40:10 SGT 2016
  • Why is that so?
  • And how to fix this (to be exactly the same) please?

Note:

I didn't setup ntp or anything (yet). I only just did this, whenever i got new Servers in hand:

# rm /etc/localtime
# ln -s /usr/share/zoneinfo/Asia/Singapore /etc/localtime
halfer
  • 19,824
  • 17
  • 99
  • 186
夏期劇場
  • 17,821
  • 44
  • 135
  • 217
  • after you setup the ntp server? – Dyno Fu Feb 23 '16 at 03:48
  • Hi @DynoFu , no i didn't. I've edited the answer with more info. Can you please check pls? :) – 夏期劇場 Feb 23 '16 at 03:50
  • without time synchronization, it's normal to have time drift, right? what is the ask here? – Dyno Fu Feb 23 '16 at 03:53
  • I simply asked: `Why is that so?` and `And how to fix this (to be exactly the same) please?` (Because i don't know. And i need help for this) – 夏期劇場 Feb 23 '16 at 03:54
  • 1
    servers without synchronization will have time drift, i.e. each server runs in its own universe and have different time, and even they are configured to start in the same time, the clock might run at slightly different pace and cause time drift. fix it with synchronization, like ntp http://www.howtogeek.com/tips/how-to-sync-your-linux-server-time-with-network-time-servers-ntp/ – Dyno Fu Feb 23 '16 at 03:58
  • btw: the down vote is not from me... – Dyno Fu Feb 23 '16 at 03:59
  • Thanks. I now just came to understand i need to install "ntp" package. And configure to SG servers. – 夏期劇場 Feb 23 '16 at 04:01
  • This question is off-topic here, as it has nothing to do with programming or programmers tools. This is a server related issue. It is probably better suited for one of the *nix sites ([ubuntu.se] or [unix.se]) or [sf] instead. (Not downvoting, although I did vote to close as off-topic.) – Ken White Feb 23 '16 at 04:03
  • @DynoFu So, if you can, please put a simple wording (to install "ntp") as in answer. So that i can mark it as answer. Thanks. – 夏期劇場 Feb 23 '16 at 04:03

1 Answers1

1

Fix it with synchronization, install ntp:

http://www.howtogeek.com/tips/how-to-sync-your-linux-server-time-with-network-time-servers-ntp/

halfer
  • 19,824
  • 17
  • 99
  • 186
Dyno Fu
  • 8,753
  • 4
  • 39
  • 64