centos時間同步方法

來源:互聯網
上載者:User

標籤:

centos時間同步方法 電腦軟硬體應用網 45IT.COM  時間:2012-12-08 18:09  作者:李本清新裝的伺服器可能設定了錯誤的,需要調整時區並調整時間.如下是使用NTP來從一個時間伺服器同步 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ntpdate us.pool.ntp.org 很簡單吧,解析一下,第一句是把當前時
 

新裝的伺服器可能設定了錯誤的,需要調整時區並調整時間.如下是使用NTP來從一個時間伺服器同步

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ntpdate us.pool.ntp.org

很簡單吧,解析一下,第一句是把當前時區調整為上海就是+8區,想改其他時區也可以去看看/usr/share/zoneinfo目錄;

然後第二句是利用ntpdate同步標準時間.

 

沒有安裝ntpdate的可以yum一下:

yum install ntp

加入定時計劃任務,每隔10分鐘同步一下時鐘

crontab -e

0-59/10 * * * * /usr/sbin/ntpdate us.pool.ntp.org | logger -t NTP

中國國家授時中心:
http://www.time.ac.cn/stime.asp

其他網路時間伺服器地址如下:(也可以自己去搜尋下)

time.nist.gov (美國)
ntp.fudan.edu.cn (複旦) )(國內使用者推薦使用此伺服器)
timekeeper.isi.edu
subitaneous.cpsc.ucalgary.ca
usno.pa-x.dec.com
time.twc.weather.com
swisstime.ethz.ch
ntp0.fau.de
ntp3.fau.de
time-a.nist.gov
time-b.nist.gov
time-nw.nist.gov
nist1-sj.glassey.com

210.72.145.44 也是一個不錯的地址,速度很快!

centos時間同步方法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.