Centos 5.5下面架设NTP服务器
# yum install ntp
#讓本服務器時間與time.nist.gov時間同步,使服務器為標準時間
[root@ntp ~]# ntpdate time.windows.com
#自動同步服務器時鐘
[root@ntp ~]# crontab -e
*/5 * * * * /usr/sbin/ntpdate time.windows.com
[root@ntp ~]# service crond restart
②配置時間源# vi /etc/ntp.conf server time.windows.com server time.lib.tsinghua.edu.cn
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org ③配置是否為其他PC提供時間服務
# vi /etc/ntp.conf
restrict 192.168.9.0 mask 255.255.255.0 nomodify notrap ④配置開機時自動運行時間服務
# chkconfig ntpd on
# 系統時間與bios事件的偏差記錄
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
# 日志
logfile /var/log/ntp.log
broadcastdelay 0.008
# service ntpd start
# service ntpd stop
# service ntpd restart ⑥驗證ntp服務已經運行
# pgrep ntpd ⑦初始同步
# ntpdate -u time.lib.tsinghua.edu.cn ⑧確認同步成功
# ntpq -p 當然,如果要提供時間服務,還必須相應的設置iptable防火墻的配置。CentOS的時間服務使用udp 123端口。
remote - 本機和上層ntp的ip或主機名,“+”表示優先,“*”表示次優先
refid - 參考上一層ntp主機地址
st - stratum階層
when - 多少秒前曾經同步過時間
poll - 下次更新在多少秒后
reach - 已經向上層ntp服務器要求更新的次數
delay - 網絡延遲
offset - 時間補償
jitter - 系統時間與bios時間差
附件里面為ntp.conf的配置文件,原始的配置文件里面有很多注釋,我把注釋全部刪除掉。就剩下干凈的配置文件;僅供參考。
轉載于:https://blog.51cto.com/287049522/424432
總結
以上是生活随笔為你收集整理的Centos 5.5下面架设NTP服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 诺基亚5800WIFI设置教程
- 下一篇: 医院管理制度【第一辑】2010年11月1