ntp服务器
学校提供ntp服务器用来校内同步
学校的ntp服务器的ip为
1 | 192.168.150.1 |
推荐使用的ntp服务器列表
阿里 腾讯 校内 三个足够
- ntp.aliyun.com
- time1.cloud.tencent.com
- 192.168.150.1
其中有一些打印机和门屏没有被授予外网权限,才被迫使用学校内的ntp服务器。
从层级和准确度上来看,阿里和腾讯的更加优秀。
使用工具
使用chrony而不是ntp,参考这篇文章 同步时间,为什么我选 Chrony 而不是 NTP ?
核心用法
先检查系统中是否存在chrony或者ntp服务
1 | sudo ps aux | grep -E "ntpd|chronyd" |
安装chrony
1 | yum install chrony |
开启服务,开机自自动,检查服务状态三连
1 | systemctl start chronyd.service |
编辑配置文件,在ubuntu上文件路径是/etc/chrony/chrony.conf
1 | vi /etc/chrony.conf |
注释掉初始的pool.ntp.org iburst
1 | Use public servers from the pool.ntp.org project. |
重启服务
1 | systemctl restart chronyd.service |
使用chrony相关命令检查
1 | chronyc tracking |