背景:
阅读新闻
RHEL6 NTP服务器的配置及故障排除
[日期:2012-07-01] 来源:51cto 作者:linuxkeep [字体:]
环境:RHEL6.0
一、配置NTP服务器 
1、安装NTP软件包 
[root@client ~]# yum install ntp -y 
2、NTP服务的配置 
[root@server ~]# grep -v "^#" /etc/ntp.conf 
driftfile /var/lib/ntp/drift 
restrict default kod nomodify notrap nopeer noquery 
restrict -6 default kod nomodify notrap nopeer noquery 
restrict 127.0.0.1 
restrict -6 ::1 
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap 
server 192.168.0.254 
server 0.rhel.pool.ntp.org 
server 1.rhel.pool.ntp.org 
server 2.rhel.pool.ntp.org 
server    127.127.1.0    # local clock 
fudge    127.127.1.0 stratum 10     
includefile /etc/ntp/crypto/pw 
keys /etc/ntp/keys 
[root@server ~]# cat /etc/ntp/step-tickers     (当NTP服务启动时,会自动与该文件中的记录的上层NTP服务进行时间校对) 
# List of servers used for initial synchronization. 
192.168.0.254 
[root@server ~]# cat /etc/sysconfig/ntpd 
# Drop root to id 'ntp:ntp' by default. 
SYNC_HWCLOCK=yes 
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g" 
3、启动ntp服务 
[root@server ~]# chkconfig ntpd on 
[root@server ~]# service ntpd start 
Starting ntpd:                                             [  OK  ] 
4、ntp测试 
[root@server ~]# ntpstat 
synchronised to local net at stratum 11 
   time correct to within 950 ms 
   polling server every 64 s 
[root@server ~]# ntpq -p 
     remote           refid      st t when poll reach   delay   offset  jitter 
============================================================================== 
server          .INIT.          16 u    -   64    0    0.000    0.000   0.000 
*LOCAL(0)        .LOCL.          10 l   50   64  177    0.000    0.000   0.000 
客户端同步时间: 
1、windows 

2、linux

[root@client ~]# date 
Wed Apr 11 10:43:30 CST 2012 
		       
	
本文评论 查看全部评论 (0)
 尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯
