#关闭chronyd时间服务
systemctl stop chronyd.service
systemctl disable chronyd.service
#调整系统时区为亚洲上海【shanghai】
timedatectl set-timezone Asia/Shanghai
#安装ntp服务, 并调整本地时间
yum -y install ntp
sed -i 's/centos.pool.ntp.org/cn.pool.ntp.org/g' /etc/ntp.conf
ntpdate -u 0.cn.pool.ntp.org
systemctl enable ntpd.service
systemctl start ntpd.service
#在crontab里面加上以下内容,定时更新时间
*/10 * * * * ntpdate 0.cn.pool.ntp.org
#常用NTP服务器
国内会比较推荐使用阿里巴巴、腾讯的公共NTP服务器,总体使用会更稳定。
ntp.aliyun.com
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
time1.cloud.tencent.com
time2.cloud.tencent.com
time3.cloud.tencent.com
time4.cloud.tencent.com
0.cn.pool.ntp.org