所在位置:首页 → 电脑知识 → Linux → Linux使用ntpdate命令同步时间

Linux使用ntpdate命令同步时间

发布: 更新时间:2023-02-14 01:29:37

为了避免主机时间因为长期运作下所导致的时间偏差,进行时间同步(synchronize)的工作是非常必要的。Linux系统下,一般使用ntp服务器来同步不同机器的时间。一台机器,可以同时是ntp服务器和ntp客户机。在网络中,推荐使用像DNS服务器一样分层的时间服务器来同步时间。

命令:ntpdate 时间服务器

一、安装ntpdate

yum install ntpdate -y

二、ntp常用服务器

国内:(注意:若不加上-u参数, 会出现以下提示:no server suitable for synchronization found)

中国国家授时中心:210.72.145.44

NTP服务器(上海) :ntp.api.bz

国外:

美国:time.nist.gov

复旦:ntp.fudan.edu.cn

微软公司授时主机(美国) :time.windows.com

台警大授时中心(台湾):asia.pool.ntp.org

三、时间同步

四、加入crontab

echo "*/20 * * * * /usr/sbin/ntpdate -u ntp.api.bz >/dev/null &" >> /var/spool/cron/root

以下是一些可用的NTP服务器地址:

NameIPLocation
210.72.145.44210.72.145.44中国(国家授时中心)
133.100.11.8133.100.11.8日本(福冈大学)
time-a.nist.gov129.6.15.28NIST,Gaithersburg,Maryland
time-b.nist.gov129.6.15.29NIST,Gaithersburg,Maryland
time-a.timefreq.bldrdoc.gov132.163.4.101NIST,Boulder,Colorado
time-b.timefreq.bldrdoc.gov132.163.4.102NIST,Boulder,Colorado
time-c.timefreq.bldrdoc.gov132.163.4.103NIST,Boulder,Colorado
utcnist.colorado.edu128.138.140.44UniversityofColorado,Boulder
time.nist.gov192.43.244.18NCAR,Boulder,Colorado
time-nw.nist.gov131.107.1.10Microsoft,Redmond,Washington
nist1.symmetricom.com69.25.96.13Symmetricom,SanJose,California
nist1-dc.glassey.com216.200.93.8Abovenet,Virginia
nist1-ny.glassey.com208.184.49.9Abovenet,NewYorkCity
nist1-sj.glassey.com207.126.98.204Abovenet,SanJose,California
nist1.aol-ca.truetime.com207.200.81.113TrueTime,AOLfacility,Sunnyvale,California
nist1.aol-va.truetime.com64.236.96.53TrueTime,AOLfacility,Virginia
标签:, ,
文章排行