免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 20488 | 回复: 11
打印 上一主题 下一主题

请教关于ntpd时间同步的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-03-12 11:05 |只看该作者 |倒序浏览
大家好
    请教一个关于时间同步的问题
    我的机器是suse11,我修改了/etc/ntp.conf的配置文件,但是在使用ntpd -q命令和公司的事件源
同步时,没有反应,请教下是不是有什么问题
    有思路的朋友麻烦指点下,事件源的配置无法看到
    /etc/ntp.conf的配置如下:
    ################################################################################
## /etc/ntp.conf
##
## Sample NTP configuration file.
## See package 'ntp-doc' for documentation, Mini-HOWTO and FAQ.
## Copyright (c) 1998 S.u.S.E. GmbH Fuerth, Germany.
##
## Author: Michael Andres,  <ma@suse.de>
##         Michael Skibbe,  <mskibbe@suse.de>
##
################################################################################

##
## Radio and modem clocks by convention have addresses in the
## form 127.127.t.u, where t is the clock type and u is a unit
## number in the range 0-3.
##
## Most of these clocks require support in the form of a
## serial port or special bus peripheral. The particular  
## device is normally specified by adding a soft link
## /dev/device-u to the particular hardware device involved,
## where u correspond to the unit number above.
##
## Generic DCF77 clock on serial port (Conrad DCF77)
## Address:     127.127.8.u
## Serial Port: /dev/refclock-u
##  
## (create soft link /dev/refclock-0 to the particular ttyS?)
##
# server 127.127.8.0 mode 5 prefer

##
## Undisciplined Local Clock. This is a fake driver intended for backup
## and when no outside source of synchronized time is available.
##
#server 127.127.1.0
# local clock (LCL)
server 192.168.200.145
fudge 127.127.1.0  stratum 10
# LCL is unsynchronized

##
## Add external Servers using
## # rcntp addserver <yourserver>
##

##
## Miscellaneous stuff
##

driftfile /var/lib/ntp/drift/ntp.drift  
# path for drift file

logfile /var/log/ntp            
# alternate log file
# logconfig =syncstatus + sysevents
# logconfig =all

# statsdir /tmp/                # directory for statistics files
# filegen peerstats  file peerstats  type day enable
# filegen loopstats  file loopstats  type day enable
# filegen clockstats file clockstats type day enable

#
# Authentication stuff
#
keys /etc/ntp.keys               
# path for keys file
trustedkey 1                     
# define trusted keys
requestkey 1                     
# key (7) for accessing server variables
# controlkey 15                 # key (6) for accessing server variables

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2012-03-12 17:25 |只看该作者
确保你有权限去连接时间源,还有先用ntpdate -o ntpserver的版本  ntpserverIP 手工同步一下,看看能不能,如果能手工同步,应该也可以自动同步

论坛徽章:
0
3 [报告]
发表于 2012-03-12 18:07 |只看该作者
谢谢bakgho 的回复,我使用ntpdate -o 192.168.200.145命令,显示出下面的错误(顺便说一下,时间源是windows的):
!!!!!!!!!!!!!!  WARNING !!!!!!!!!!!!!!!!!!

The ntpdate program is deprecated and should not be used any more.  To
quote the upstream ntp developers:

  "The functionality ntpdate offered is now provided by the ntpd daemon
  itself.  If you call ntpd with the command line option -q it will
  retrieve the current time and set it accordingly."

Please check the Network Time Protocol (NTP) daemon man page and
  http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
for further information.

You can replace the ntpdate call with "rcntp ntptimeset" to achieve an
inital poll of the servers specified in /etc/ntp.conf.

The program /usr/sbin/sntp offers comparable functionality to ntpdate.
Specifically
  sntp -P no -r pool.ntp.org
is equivalent to
  ntpdate pool.ntp.org

For further details please refer to the man page of sntp.
sntp: too many bad or lost packets

论坛徽章:
0
4 [报告]
发表于 2012-03-13 10:31 |只看该作者
有思路的朋友帮忙点拨下,谢谢

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
5 [报告]
发表于 2012-03-13 15:00 |只看该作者
还没有试过linux下的ntp同步windows时间源,还有你的ntpdate命令有点错误,-o选项是标明ntpServer端的ntd版本,如果不知道可以不用-o选项,而ntp默认的版本4,

论坛徽章:
0
6 [报告]
发表于 2012-03-13 17:41 |只看该作者
谢谢bakgho的回复,我用ntpdate 192.168.200.145显示如下错误:
       !!!!!!!!!!!!!!  WARNING !!!!!!!!!!!!!!!!!!

The ntpdate program is deprecated and should not be used any more.  To
quote the upstream ntp developers:

  "The functionality ntpdate offered is now provided by the ntpd daemon
  itself.  If you call ntpd with the command line option -q it will
  retrieve the current time and set it accordingly."

Please check the Network Time Protocol (NTP) daemon man page and
  http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
for further information.

You can replace the ntpdate call with "rcntp ntptimeset" to achieve an
inital poll of the servers specified in /etc/ntp.conf.

The program /usr/sbin/sntp offers comparable functionality to ntpdate.
Specifically
  sntp -P no -r pool.ntp.org
is equivalent to
  ntpdate pool.ntp.org

For further details please refer to the man page of sntp.
sntp: too many bad or lost packets

论坛徽章:
0
7 [报告]
发表于 2012-03-21 14:20 |只看该作者
网络上要开通UDP协议的123端口哦

论坛徽章:
0
8 [报告]
发表于 2012-06-02 20:07 |只看该作者
我也是碰到一样的情况,不过ntp服务器是linux的,楼主问题解决了没有,请告诉下是怎么解决的。

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
9 [报告]
发表于 2012-06-03 08:33 |只看该作者
The ntpdate program is deprecated and should not be used any more.

提示已经很明白了,用sntp替代ntpdate了

论坛徽章:
0
10 [报告]
发表于 2012-06-03 10:01 |只看该作者
sntp和ntpdate命令都尝试过了,不同的是sntp只提示:"sntp: too many bad or lost packets”,在网上搜索了下,有人说是服务端的ntp服务异常(检查了网络是通的、服务端的UDP 123端口也是开的),但是不知道怎么检查,求高人指点。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP