缙哥哥在宝塔官方论坛查询了相关帖子,发现有很多人有此问题,并且没有得到解决办法。为此,缙哥哥又在各个地方查找相关资料,今天终于解决了这个宝塔在 CentOS 7 操作系统上时间错误并不同步的问题。
这是缙哥哥使用了Chrony后显示了正确的时间,小伙伴们也可以使用 timedatectl 指令查看服务器时间。
[root@localhost ~]# timedatectl Local time: Fri 2018-08-24 15:53:17 CST Universal time: Fri 2018-08-24 07:53:17 UTC RTC time: Fri 2018-08-24 07:53:18 Time zone: n/a (CST, +0800) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/a
安装启动Chrony
yum -y install chrony systemctl start chronyd systemctl status chronyd
虽然“Universal time”和“RTC time”还不对,但至少宝塔这边已经没有问题了,可以正常使用了!
其他问题
如果遇到下方这个情况
Warning: The system is configured to read the RTC time in the local time zone.This mode can not be fully supported. It will create various problems with time zone changes and daylight aving time adjustments. The RTC time is never updated, it relies on external facilities to maintain it.
缙哥哥完全不知道特么在说什么,经过翻译软件翻译,说是:系统被配置为在本地时区读取RTC时间。这种模式不能完全支持。它会产生各种各样的问题,随着时区的变化和夏令时的调整。时间永远不会更新,它依赖于外部设施来维护它。如果碰到这个问题,可以输入以下指令来解决:
timedatectl set-local-rtc 0
好了,就讲这么多了,有问题可以在评论留言。
评论前必须登录!
注册