溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

NTP時間服務器搭建

發布時間:2020-08-05 09:57:56 來源:網絡 閱讀:498 作者:jiege333 欄目:建站服務器

1. NTP

NTPNetwork Time Protocol,網絡時間協議)是用來使網絡中的各個計算機時間同步的一種協議。它的用途是把計算機的時鐘同步到世界協調時UTC,其精度在局域網內可達0.1ms,在互聯網上絕大多數的地方其精度可以達到1-50ms。

NTP服務器就是利用NTP協議提供時間同步服務的。

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     #看同步狀態

3客時間同步

 crontab -e

 */15 * * * * /usr/sbin/ntpdate 192.168.100.102(服務器端IP)

  注意

 客戶機要等幾分鐘再與新啟動的ntp服務器進行時間同步,否則會提示no server suitable for       synchronization found錯誤


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女