早上朋友打電話過來作了個NTP服務器一直不成功,而後本身也配置了一下,服務器
本人用的是redhat 5.3ide
yum install ntpui
不少時候系統已經安裝的了rest
修改配置文件 vi /etc/ntp.conf server
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap ---容許同步服務器的網段
rem
#server 192.168.1.90 ---這個能夠不寫的只留下最後2個
server 127.127.1.0 --意思是獲取本機時間做爲NTP服務器標準時間
fudge 127.127.1.0 stratum 10同步
保存退出it
/etc/init.d/ntpd startio
查看一下有沒有運行 lsof -i:123table
在客戶端運行 ntpdate 192.168.1.90 同步時間
出現「no server suitable for synchronization found 」 多是你等待時間還不夠。
緣由是服務器還沒更新本地時間,怎麼麼看呢,能夠運行下命令 watch ntpq -p
-------------------------------------
Every 2.0s: ntpq -p Sat Dec 4 18:04:30 2010
remote refid st t when poll reach delay offset jitter
==============================================================================
squid.dog.com .INIT. 16 u - 64 0 0.000 0.000 0.000
*LOCAL(0) .LOCL. 10 l 29 64 1 0.000 0.000 0.001
when 一直在跳 當reach的值變成17就會暫時停下來了,這時候就能夠在客戶端使用
ntpdate -d 192.168.1.90 來檢測是否成功了
最後同步
ntpdate 192.168.1.90