NTP时间同步总结

Linux服务需要时间戳的时候,时间同步就显得十分重要。
Centos系统时间同步的命令为:ntpdate

安装ntpdate:

yum install ntpdate -y

NTP时间服务器地址:

210.72.145.44 (国家授时中心服务器IP地址) 
133.100.11.8 日本 福冈大学 
time-a.nist.gov 129.6.15.28 NIST, Gaithersburg, Maryland 
time-b.nist.gov 129.6.15.29 NIST, Gaithersburg, Maryland 
time-a.timefreq.bldrdoc.gov 132.163.4.101 NIST, Boulder, Colorado 
time-b.timefreq.bldrdoc.gov 132.163.4.102 NIST, Boulder, Colorado 
time-c.timefreq.bldrdoc.gov 132.163.4.103 NIST, Boulder, Colorado 
utcnist.colorado.edu 128.138.140.44 University of Colorado, Boulder 
time.nist.gov 192.43.244.18 NCAR, Boulder, Colorado 
time-nw.nist.gov 131.107.1.10 Microsoft, Redmond, Washington 
nist1.symmetricom.com 69.25.96.13 Symmetricom, San Jose, California 
nist1-dc.glassey.com 216.200.93.8 Abovenet, Virginia 
nist1-ny.glassey.com 208.184.49.9 Abovenet, New York City 
nist1-sj.glassey.com 207.126.98.204 Abovenet, San Jose, California 
nist1.aol-ca.truetime.com 207.200.81.113 TrueTime, AOL facility, Sunnyvale, California 
nist1.aol-va.truetime.com 64.236.96.53 TrueTime, AOL facility, Virginia 
———————————————————————————————————— 
ntp.sjtu.edu.cn (上海交通大学网络中心NTP服务器地址202.120.2.101) 
s1a.time.edu.cn 北京邮电大学 
s1b.time.edu.cn 清华大学 
s1c.time.edu.cn 北京大学 
s1d.time.edu.cn 东南大学 
s1e.time.edu.cn 清华大学 
s2a.time.edu.cn 清华大学 
s2b.time.edu.cn 清华大学 
s2c.time.edu.cn 北京邮电大学 
s2d.time.edu.cn 西南地区网络中心 
s2e.time.edu.cn 西北地区网络中心 
s2f.time.edu.cn 东北地区网络中心 
s2g.time.edu.cn 华东南地区网络中心 
s2h.time.edu.cn 四川大学网络管理中心 
s2j.time.edu.cn 大连理工大学网络中心 
s2k.time.edu.cn CERNET桂林主节点 
s2m.time.edu.cn 北京大学

比较稳定的国内NTP时间服务器地址:

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循环检测

for n in {1..7};
    do 
        /usr/sbin/ntpdate ntp$n.aliyun.com;
        sleep 1; 
    done

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

[root@myhost~]# crontab -l
*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null
*/5 * * * * /usr/sbin/ntpdate ntp2.aliyun.com &>/dev/null
*/5 * * * * /usr/sbin/ntpdate ntp3.aliyun.com &>/dev/null

猜你喜欢

转载自blog.csdn.net/yuki5233/article/details/81453836
今日推荐