新聞中心
1. NTP簡介
NTP(Network Time Protocol,網(wǎng)絡時間協(xié)議)是用來使網(wǎng)絡中的各個計算機時間同步的一種協(xié)議。它的用途是把計算機的時鐘同步到世界協(xié)調(diào)時UTC,其精度在局域網(wǎng)內(nèi)可達0.1ms,在互聯(lián)網(wǎng)上絕大多數(shù)的地方其精度可以達到1-50ms。
NTP服務器就是利用NTP協(xié)議提供時間同步服務的。
2. NTP服務器安裝
yum -y install ntp
vim /etc/ntp.conf
允許任何ip的客戶機都可以進行時間同步
將restrict default kod nomodify notrap nopeer noquery修改為如下行:
Restrict default nomodify #nomodify客戶端可以同步
# 將默認時間同步源注釋改用可用源
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server ntp1.aliyun.com
server time.nist.gov
加入定時任務同步時間
crontab -e
*/5 * * * * /usr/sbin/ntpdate time.nist.gov >/dev/null 2>&1
/etc/init.d/ntpd start
chkconfig ntpd on
ntpq -p ntpstat #看同步狀態(tài)
3客戶機時間同步
crontab -e
*/15 * * * * /usr/sbin/ntpdate 192.168.100.102(服務器端IP)
注意
客戶機要等幾分鐘再與新啟動的ntp服務器進行時間同步,否則會提示no server suitable for synchronization found錯誤
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
本文名稱:NTP時間服務器搭建-創(chuàng)新互聯(lián)
分享網(wǎng)址:http://fisionsoft.com.cn/article/hoedi.html