1、NTP服務器環境介紹
操作系統:CentOS Linux release 7.2.1511 (Core)
內核:3.10.0-327.4.5.el7.x86_64
主機名:ntp01
2、安裝ntp服務
yum -y install ntp
3、修改 ntp配置
(1)driftfile /var/lib/ntp/drift
記錄和上級時間服務器的時間差異,默認配置,保留
(2)restrict default nomodify
表示nomodify客戶端可以同步時間
(3)restrict 127.0.0.1
restrict ::1
允許本機的一切操作,默認策略,保留
(4)restrict ntp.aliyun.com
阿里雲NTP服務可修改本NTP服務時間
(5)server ntp.aliyun.com
添加阿里雲時間源
4、啟動NTP服務
啟動:systemctl start ntpd
設置開機自啟:systemctl enable ntpd
確認事件源:ntpq -p