安装ntp服务
sudo yum install ntp
sudo systemctl enable ntpd
修改NTP配置
vi /etc/ntp.conf
将时间服务器换成国内的
server
0.cn.pool.ntp.orgserver
1.cn.pool.ntp.orgserver
2.cn.pool.ntp.orgserver
3.cn.pool.ntp.org
重启NTP服务
sudo systemctl restart ntpd
检查时间是否同步
ntpq -p
如果正常的话会显示类似如下
查看当前时间
date
常用故障排除参考
参考
How to Sync Your Linux Server Time with Network Time Servers (NTP)