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设置教程
- 下一篇: Centos 6.2部署CSVN服务器