CentOS 7 中使用NTP進行時間同步

來源:互聯網
上載者:User

標籤:

1、確認已經ntp程式包: # yum install ntp  2、配置時間源 # vi /etc/ntp.conf server pool.ntp.org #可選擇其他優先伺服器server 2.cn.pool.ntp.orgserver 1.asia.pool.ntp.orgserver 2.asia.pool.ntp.org # 允許上層時間伺服器主動修改本機時間restrict 2.cn.pool.ntp.org nomodify notrap noqueryrestrict 1.asia.pool.ntp.org nomodify notrap noqueryrestrict 2.asia.pool.ntp.org nomodify notrap noqueryserver 127.0.0.1 # local clockfudge 127.0.0.1 stratum 10 3、配置是否為其他PC提供時間服務 # vi /etc/ntp.conf restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap  4、配置開機時自動已耗用時間服務 # chkconfig ntpd on  5、啟動或停止時間服務 # service ntpd start # service ntpd stop # service ntpd restart  6、驗證ntp服務已經運行 # pgrep ntpd  7、首次同步處理# ntpdate -u time.lib.tsinghua.edu.cn 8、確認同步成功# ntpq -p 9、同時建議修改一下 /etc/sysconfig/ntpd 檔案 # vi /etc/sysconfig/ntpd  SYNC_HWCLOCK=yes  # 改成 yes 吧!這樣主機 BIOS 的時間也會跟著一起改變的!  當然,如果要提供時間服務,還必須相應的設定iptable防火牆的配置。CentOS的時間服務使用udp 123連接埠。


更多詳情請諮詢 鼎峰胡佳雄
TEL.18824258907
QQ.2881064155

CentOS 7 中使用NTP進行時間同步

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.