/ 2018-08-15
老男孩老师在教学培训过程中经常发现曾经的时间服务器地址不可用了,很是尴尬,特找到了国内比较稳定的时间服务器地址,和网友分享如下:
1ntp1.aliyun.com
2ntp2.aliyun.com
3ntp3.aliyun.com
4ntp4.aliyun.com
5ntp5.aliyun.com
6ntp6.aliyun.com
7ntp7.aliyun.com
在Linux里使用的语法为:
ntpdate ntp1.aliyun.com
写个for循环检测如下:
1[root@oldboy ~]# for n in {1..7};do /usr/sbin/ntpdate ntp$n.aliyun.com;sleep 1;done
229 Apr 14:00:40 ntpdate[9957]: adjust time server 182.92.12.11 offset 0.005580 sec
329 Apr 14:00:41 ntpdate[9959]: adjust time server 120.25.115.19 offset 0.005063 sec
429 Apr 14:00:42 ntpdate[9961]: adjust time server 203.107.6.88 offset 0.005143 sec
529 Apr 14:00:44 ntpdate[9963]: adjust time server 203.107.6.88 offset 0.004761 sec
629 Apr 14:00:45 ntpdate[9965]: adjust time server 182.92.12.11 offset 0.004231 sec
729 Apr 14:00:46 ntpdate[9967]: adjust time server 203.107.6.88 offset 0.003692 sec
829 Apr 14:00:47 ntpdate[9969]: adjust time server 120.25.115.19 offset 0.002582 sec
确实都好用,网友使用时,如果某一个不好用了,可以换一下试试。
企业工作中配置时间同步任务实践如下,尽量配置两个地址,防止某一个出问题:
1[root@oldboy ~]# crontab -l
2#time sync by oldboy at 20180429
3*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null
4*/5 * * * * /usr/sbin/ntpdate ntp3.aliyun.com &>/dev/null
运维人员也可以在网内搭建NTP时间服务器,老男孩课程教学中都有讲,故不在累述。
(2)