Koozali.org formerly Contribs.org

Data e ora server sbagliate

Offline Mat78

Data e ora server sbagliate
« on: January 18, 2019, 09:34:20 AM »
Buongiorno a tutti,
questa mattina ho notato sul mio server che l'ora รจ sbagliata, l'orologio del sistema (anche se sincronizzato con i time server) segnala le 8:53 mentre sono le 9:33.

Per caso qualcuno ha avuto lo stesso problema e sa come possa essere risolto?

Grazie in anticipo


Offline mmccarn

  • *
  • 2,358
Re: Data e ora server sbagliate
« Reply #1 on: January 18, 2019, 01:10:23 PM »
Google translation of this topic (english to italian):

NTP stops syncing (by default) if your system clock is more than 1000 seconds off from the servers you're syncing with.

If that happens, you need to reset the system clock manually.  This command will usually do that:
Code: [Select]
ntpdate -u pool.ntp.org

Once your system time is approximately correct, you can check the ntp status using "ntpq".  The entry marked with "*" is the server currently being used by my system:
Code: [Select]
# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
*     2 u  140 1024  377   64.726    0.647  13.222
+      2 u  456 1024  377    9.291    0.780   4.991
+    2 u  670 1024  377   29.494   -2.097   0.753
-      3 u  508 1024  371   72.938    2.256   5.367     .LOCL.          10 l  20d   64    0    0.000    0.000   0.000

Some things that can cause your system time to get out of sync (in case it happens again):

- Virtual servers used to require some special settings for ntpd (I don't know if this is still a problem):

- The server's hardware clock may be acting up, or may no longer be supported by Centos 6

- A bad motherboard battery can sometimes cause a physical server to boot with the wrong time when rebooted (my last server hardware had this problem, so I created a cron job to run '@reboot' to run ntpdate and set the server's time)