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

Matteo

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):
http://translate.google.com/translate?hl=it&sl=en&tl=it&u=https%3A%2F%2Fforums.contribs.org%2Findex.php%3Ftopic%3D53889.0%3Btopicseen

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
==============================================================================
*208.75.88.4     192.12.19.20     2 u  140 1024  377   64.726    0.647  13.222
+50.116.52.97    192.5.41.41      2 u  456 1024  377    9.291    0.780   4.991
+104.155.144.4   216.239.35.12    2 u  670 1024  377   29.494   -2.097   0.753
-96.8.121.205    140.142.1.8      3 u  508 1024  371   72.938    2.256   5.367
 127.127.1.0     .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):
https://wiki.contribs.org/Virtual_SME_Server#NTPD

- The server's hardware clock may be acting up, or may no longer be supported by Centos 6
https://forums.contribs.org/index.php?topic=51088.0

- 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)