[筆記]Linux NTP命令 (ESX適用)

來源:互聯網
上載者:User

標籤:blog   http   使用   os   檔案   art   

原創作品,允許轉載,轉載時請務必以超連結形式標明文章 原始出處 、作者資訊和本聲明。否則將追究法律責任。http://delxu.blog.51cto.com/975660/307513【推薦閱讀】這篇最好:http://wiki.ubuntu.org.cn/Quick_HOWTO_:_Ch24_:_The_NTP_Server/zh 
NTP 命令列:http://www.linux-consulting.com/NTP/NTP.Commands.txt 
Timekeep Best Practice for Linux Guest:http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427 
https://www.vmware.com/pdf/vmware_timekeeping.pdf ==========================================/etc/ntp.conf 檔案是ESX/Linux NTP的主要設定檔
啟動,停止,重啟NTP,用下面的命令:[[email protected] tmp]# service ntpd start 
[[email protected] tmp]# service ntpd stop 
[[email protected] tmp]# service ntpd restart
使用下面的命令檢查NTP服務是否運行[[email protected] tmp]# pgrep ntpd 
檢查ntp同步狀況 
[[email protected] tmp]# ntpq -p
手動和某一伺服器同步(必須要跟伺服器位址),運行這個命令要求先關閉ntpd服務。用service ntpd stop來停止ntpd[[email protected] tmp]# ntpdate 0.pool.ntp.org
ntpdate 命令在smallfry機器上運行了3次去同步192.168.1.100伺服器的時間,不過它必須在ntpd進程停止的時候運行,所以你要先停止ntpd,運行ntpdate,然後再運行ntpd.[[email protected] tmp]# service ntpd stop 
[[email protected] tmp]# ntpdate -u 192.168.1.100 
Looking for host 192.168.1.100 and service ntp 
host found : bigboy.my-site.com 
12 Aug 08:03:38 ntpdate[2472]: step time server 192.168.1.100 offset 28993.084943 sec 
[[email protected] tmp]# ntpdate -u 192.168.1.100 
Looking for host 192.168.1.100 and service ntp 
host found : bigboy.my-site.com 
12 Aug 08:03:40 ntpdate[2472]: step time server 192.168.1.100 offset 2.467652 sec 
[[email protected] tmp]# ntpdate -u 192.168.1.100 
Looking for host 192.168.1.100 and service ntp 
host found : bigboy.my-site.com 
12 Aug 08:03:42 ntpdate[2472]: step time server 192.168.1.100 offset 0.084943 sec
[[email protected] tmp]# service ntpd start 
[[email protected] tmp]# 

排錯時候查看有關ntpd的日誌 
[[email protected] tmp]# cat /var/log/messages | grep ntpd

本文出自 “delxu Tech Notebook” 部落格,請務必保留此出處http://delxu.blog.51cto.com/975660/307513

聯繫我們

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