MySQL(MariaDB)服务器上的 RTC/UTC 不准确。我已修复此问题 - 很糟糕吗?

MySQL(MariaDB)服务器上的 RTC/UTC 不准确。我已修复此问题 - 很糟糕吗?

作为一名公认的绿色服务器管理员,我临时接替了工作。我在 MariaDB 服务器上安装了大量安全补丁,但该服务器的存储库配置不正确(不是我配置的),并且有一段时间没有收到补丁。安装并重新启动后,我发现所有时钟都慢了一个小时。

timedatectl 建议将 RTC 设置为 UTC 而不是本地时间,所以我照做了。然后我使用 ntpdate 来校正 RTC。

现在一切似乎都运行良好,但我是否搞砸了正在运行的 SQL 数据库中的时间戳?是的,我应该在更改时间之前想到这一点。我登录了一个 Web CRM 应用程序并环顾四周:上周所做的更改仍然具有正确的时间戳。mariadb 会自动检测和处理 RTC 更改吗?

mysql1:~ # date
Mon Feb  8 11:34:04 CST 2016
mysql1:~ # hwclock --show
Mon Feb  8 11:34:44 2016  -0.757576 seconds
mysql1:~ # timedatectl
      Local time: Mon 2016-02-08 11:35:10 CST
  Universal time: Mon 2016-02-08 17:35:10 UTC
        RTC time: Mon 2016-02-08 11:35:17
        Timezone: America/Chicago (CST, -0600)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: yes
      DST active: no
 Last DST change: DST ended at
                  Sun 2015-11-01 01:59:59 CDT
                  Sun 2015-11-01 01:00:00 CST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2016-03-13 01:59:59 CST
                  Sun 2016-03-13 03:00:00 CDT

Warning: The RTC is configured to maintain time in the local timezone. This
         mode is not fully supported and will create various problems with time
         zone changes and daylight saving adjustments. If at all possible use
         RTC in UTC, by calling 'timedatectl set-local-rtc 0'.
mysql1:~ # timedatectl set-local-rtc 0
mysql1:~ # timedatectl
      Local time: Mon 2016-02-08 11:36:24 CST
  Universal time: Mon 2016-02-08 17:36:24 UTC
        RTC time: Mon 2016-02-08 17:36:24
        Timezone: America/Chicago (CST, -0600)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2015-11-01 01:59:59 CDT
                  Sun 2015-11-01 01:00:00 CST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2016-03-13 01:59:59 CST
                  Sun 2016-03-13 03:00:00 CDT
mysql1:~ # ntpdate ntp.uiuc.edu
 8 Feb 10:40:03 ntpdate[26539]: step time server 130.126.24.44 offset -3591.072249 sec
mysql1:~ # timedatectl
      Local time: Mon 2016-02-08 10:40:08 CST
  Universal time: Mon 2016-02-08 16:40:08 UTC
        RTC time: Mon 2016-02-08 17:40:00
        Timezone: America/Chicago (CST, -0600)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2015-11-01 01:59:59 CDT
                  Sun 2015-11-01 01:00:00 CST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2016-03-13 01:59:59 CST
                  Sun 2016-03-13 03:00:00 CDT

相关内容