本文最后更新于:October 26, 2019 pm
国内常用的NTP时间服务器,可以用于Linux中的NTP时间同步或者是chrony时间同步。
1、NTP时间服务器域名
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| # 国家授时中心 ntp.ntsc.ac.cn
# 阿里云 ntp.aliyun.com
# 北京邮电大学 s1a.time.edu.cn
# 清华大学 s2b.time.edu.cn
# 北京邮电大学 s2c.time.edu.cn
# 西南地区网络中心 s2d.time.edu.cn
# 西北地区网络中心 s2e.time.edu.cn
# 东北地区网络中心 s2f.time.edu.cn
|
2、使用crontab+ntpdate同步
| crontab -e -u root * */1 * * * (/usr/sbin/ntpdate ntp.ntsc.ac.cn)
|
3、使用chrony同步
此处我们使用CentOS8作为展示。

| yum install chrony -y
systemctl enable chronyd.service systemctl start chronyd.service systemctl status chronyd.service
|
chrony的配置文件目录位于/etc/chrony.conf
,我们将里面默认的服务器注释掉,换成阿里云和国家时间中心的服务器。

然后我们重启服务查看一下状态
| systemctl restart chronyd.service
chronyc sourcestats -v chronyc sources -v
|


如上图所示显示System clock synchronized
状态为yes
并且NTP service
显示为active
则说明已经配置成功了。