上海锐呈电气有限公司

智能制造网免费14

收藏

Linux 网络时钟服务器、网络时钟同步服务器、NTP对时器的配置

时间:2011-08-19      阅读:1186

 网络时钟服务器、网络时钟同步服务器、NTP对时器(192.168.1.96) 

1. # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm 
2. # vi /etc/ntp.conf 
注释一行 
restrict default ignore 
加入一行 
restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap 

#cat /etc/ntp.conf 

#restrict default nomodify notrap noquery 
restrict 127.0.0.1 
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap 
server  
server  
server  
server 127.127.1.0 # local clock 
fudge 127.127.1.0 stratum 10 
driftfile /var/lib/ntp/drift 
broadcastdelay 0.008 
keys /etc/ntp/keys 

3. # vi /etc/ntp/step-tickers 
加入一行 
 
这样每次ntpd启动时,会自动连接该标准时间服务器。 

4. # service ntpd start 

5. # netstat -an |grep 123 
确保该端口以udp方式开放。 


客户端(192.168.1.30) 
1. # ntpdate 192.168.1.96 
应该显示同步成功 
2. # crontab -e 
加入 
*/10 * * * * /usr/sbin/ntpdate 192.168.1.96 
表示每隔10分钟同步一次时间 


[root@game96 ~]# ntpq -p 
remote refid st t when poll reach delay offset jitter 
============================================================================== 
*222.73.214.1 209.81.9.7 2 u 62 64 377 10.434 57.669 25.595 
+222.73.214.125 209.81.9.7 2 u 53 64 377 12.487 59.238 36.039 
+218.21.130.42 209.51.161.238 2 u 53 64 377 43.089 57.064 38.769 
LOCAL(0) LOCAL(0) 10 l 58 64 377 0.000 0.000 0.001 
这个命令检查时间服务器同步的状态,+代表目前正在使用的NTP服务器,*代表次要NTP服务器。 

[root@game96 ~]# ntpstat 
synchronised to NTP server (222.73.214.1) at stratum 3 
time correct to within 286 ms 
polling server every 64 s 
这个命令列出网络时钟服务器、网络时钟同步服务器、NTP对时器与上层服务器是否连接。 

[root@game96 ~]# ntptrace -n 127.0.0.1 
127.0.0.1: stratum 3, offset 0.058552, synch distance 0.388675 
222.73.214.1: stratum 2, offset -0.003833, synch distance 0.112924 
209.81.9.7: stratum 1, offset 0.000022, synch distance 0.000392, refid 'GPS' 
这个命令列出目前我们的NTP服务器与上层NTP服务器彼此之间的关系。

以上就是Linux NTP时间服务器的配置的简介。

公司名称:上海锐呈电气有限公司

地址:上海市翔殷路128号上海理工大学国家科技园1号楼

200433

51816732

:魏元栋

rcdq123@

1078860159

/

      /St40821

上一篇: GPS卫星授时器、北斗卫星授时器、GPS同步时钟在桥梁检测中的应用 下一篇: NTP网络同步时钟服务器、网络时钟服务器、NTP时间服务器的架设方案
提示

请选择您要拨打的电话: