可以给设备添加ntp服务
yum install ntp
systemctl enable ntpd
systemctl start ntpd
检查在centos的系统中是否有chrony服务,有的话卸载掉,会和ntp服务起冲突,导致设备重启后ntp失效
rpm -qa | grep chrony #检查有没有chrony服务,会和ntp冲突,卸载掉
systemctl stop chronyd
systemctl disable chronyd
卸载完成后检查ntp是否恢复正常
systemctl status ntpd #检查ntpd的服务状态,如果没开启啧再运行下列命令
systemctl enable ntpd
systemctl start ntpd
再次检查clock和date显示的时间是否正常
一致的话把系统时间和硬件时间同步
hwclock --systohc
reboot重启设备,重新核验系统时间和硬件时间是否一致