博客前几天迁移到米兰的年付12欧的小鸡,发现系统时间有问题,快2个小时,导致NSD的DNS主从服务同步域名zone文件出错,今天好好研究了一下
1、Centos 8 默认没有ntp软件,只能用chrony代替
###安装yum -y install chrony
###修改chrony配置文件
[root@mil ~]# vi /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.africa.pool.ntp.org iburst
server 1.africa.pool.ntp.org iburst
server 2.africa.pool.ntp.org iburst
server 3.africa.pool.ntp.org iburst
###设置开机自启动和启动chrony
systemctl enable chronyd
systemctl restart chronyd
2、坑来了
[root@mil ~]# timedatectl status
Local time: Tue 2020-06-30 21:00:51 CST
Universal time: Tue 2020-06-30 13:00:51 UTC
RTC time: Tue 2020-06-30 13:00:51
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no (这是为yes才可以,但是系统一直是no的一种状态)
NTP service: active
RTC in local TZ: no
###解决方案:
[root@mil ~]# hwclock --systohc --utc (修改硬件时间为UTC格式)
[root@mil ~]# timedatectl status
Local time: Tue 2020-06-30 21:03:04 CST
Universal time: Tue 2020-06-30 13:03:04 UTC
RTC time: Tue 2020-06-30 13:03:04
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
###问题解决
还没有任何评论,你来说两句吧