vi /etc/sysconfig/ntpd#允许BIOS与系统时间同步,添加下面一行。
SYNC_HWCLOCK=yes
五.检测NTP
1.检测NTP服务是否运行
# netstat -tlunp | grep ntpudp 0 0 192.168.1.101:123 0.0.0.0:*2563/ntpdudp 0 0 127.0.0.1:1230.0.0.0:*2563/ntpdudp 0 0 0.0.0.0:1230.0.0.0:*2563/ntpdudp6 0 0 fe80::20c:29ff:fe7b:123 :::*2563/ntpdudp6 0 0 ::1:123:::*2563/ntpdudp6 0 0 :::123:::*2563/ntpd
2.查看ntp服务器有无和上层ntp连通
# ntpstatsynchronised to NTP server (120.25.108.11) at stratum 3 time correct to within 99 ms polling server every 64 s
3.查看ntp服务器与上层ntp的状态

# ntpq -premoterefid st t when poll reach delay offset jitter============================================================================== news.neu.edu.cn .INIT.16 u - 64 0 0.000 0.000 0.000x202.118.1.130 202.118.1.47 2 u 7 64 377 153.659 9.605 19.941*time4.aliyun.co 10.137.38.86 2 u 10 64 377 39.666 -47.661 15.944remote - 本机和上层ntp的ip或主机名,“+”表示优先,“*”表示次优先refid - 参考上一层ntp主机地址st - stratum阶层when - 多少秒前曾经同步过时间poll - 下次更新在多少秒后reach - 已经向上层ntp服务器要求更新的次数delay - 网络延迟offset - 时间补偿jitter - 系统时间与bios时间差
六.配置时间同步客户机
1.执行ntpdate命令:
ntpdate 192.168.1.101 #192.168.1.101为ntp服务器IP地址
2.写入BIOS
hclock -w
3.crond服务
vi /etc/crontab
30 8 * * * root /usr/sbin/ntpdate 192.168.1.101; /sbin/hwclock -w
4.重启crond服务
service crond restart
以上就是小编为大家带来的linux配置ntp服务器的方法全部内容了,希望大家多多支持脚本之家~
您可能感兴趣的文章:
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-76295-2.html
但是你也要说的和做的一样