老男孩老师在教学培训过程中经常发现曾经的时间服务器地址不可用了,很是尴尬,特找到了国内比较稳定的时间服务器地址,和博友分享如下:

ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com

Linux里使用的语法为:

ntpdate ntp1.aliyun.com

写个for循环检测如下:

[root@oldboy ~]# for n in {1..7};do /usr/sbin/ntpdate ntp$n.aliyun.com;sleep 1;done

29 Apr 14:00:40 ntpdate[9957]: adjust time server 182.92.12.11 offset 0.005580 sec

29 Apr 14:00:41 ntpdate[9959]: adjust time server 120.25.115.19 offset 0.005063 sec

29 Apr 14:00:42 ntpdate[9961]: adjust time server 203.107.6.88 offset 0.005143 sec

29 Apr 14:00:44 ntpdate[9963]: adjust time server 203.107.6.88 offset 0.004761 sec

29 Apr 14:00:45 ntpdate[9965]: adjust time server 182.92.12.11 offset 0.004231 sec

29 Apr 14:00:46 ntpdate[9967]: adjust time server 203.107.6.88 offset 0.003692 sec

29 Apr 14:00:47 ntpdate[9969]: adjust time server 120.25.115.19 offset 0.002582 sec

确实都好用,网友使用时,如果某一个不好用了,可以换一下试试。

企业工作中配置时间同步任务实践如下,尽量配置两个地址,防止某一个出问题:

[root@oldboy ~]# crontab -l

#time sync by oldboy at 20180429

*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null

*/5 * * * * /usr/sbin/ntpdate ntp3.aliyun.com &>/dev/null

运维人员也可以在网内搭建NTP时间服务器,老男孩课程教学中都有讲,不在累述。