第一步,安裝NTP
yum install ntp
第二步,修改ntp.conf配置檔案
vi /etc/ntp.conf
配置如下:
server 10.255.255.254 #設定為你的NTP伺服器IP位址
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org
server 3.centos.pool.ntp.org
server 4.centos.pool.ntp.org
第三步,關閉/開啟/重新開機NTP服務:
service ntpd stop #關閉
service ntpd start #開啟
service ntpd restart #重新開機
檢視NTP運作狀況:
[[email protected] etc]# ntpstat
synchronised to local net at stratum 6
time correct to within 949 ms
polling server every 64 s
檢視NTP連接配接情況:
[[email protected] etc]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*10.255.255.254 203.107.6.88 3 u 125 128 377 0.315 0.281 0.686
LOCAL(0) .LOCL. 5 l 1071 64 0 0.000 0.000 0.000
第五步,設定開機啟動服務:
chkconfig ntpd on