行业产品

  • 行业产品

上海锐呈电气有限公司


当前位置:上海锐呈电气有限公司>技术文章>Linux 网络时钟服务器、网络时钟同步服务器、NTP对时器的配置

经营模式:生产厂家

商铺产品:100条

所在地区:上海上海市

联系人:采购部 (经理)

技术文章

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

阅读:1184发布时间:2011-8-19

 网络时钟服务器、网络时钟同步服务器、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


智能制造网 设计制作,未经允许翻录必究 .      Copyright(C) 2021 https://www.gkzhan.com,All rights reserved.

以上信息由企业自行提供,信息内容的真实性、准确性和合法性由相关企业负责,智能制造网对此不承担任何保证责任。 温馨提示:为规避购买风险,建议您在购买产品前务必确认供应商资质及产品质量。

会员登录

×

请输入账号

请输入密码

=

请输验证码

收藏该商铺

登录 后再收藏

提示

您的留言已提交成功!我们将在第一时间回复您~