免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: liyaweihesmz
打印 上一主题 下一主题

[其他] NTP服务 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2013-05-10 13:43 |只看该作者
回复 8# wenhq
我查看日志信息中有如下信息。最后一行的提示信息我不清楚是杂回事了。
  1. May 10 13:36:48 wyh ntpd[21449]: ntpd 4.2.4p8@1.1612-o Thu Jan 10 15:17:24 UTC 2013 (1)
  2. May 10 13:36:48 wyh ntpd[21450]: precision = 0.291 usec
  3. May 10 13:36:48 wyh ntpd[21450]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
  4. May 10 13:36:48 wyh ntpd[21450]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
  5. May 10 13:36:48 wyh ntpd[21450]: Listening on interface #1 wildcard, ::#123 Disabled
  6. May 10 13:36:48 wyh ntpd[21450]: Listening on interface #2 lo, ::1#123 Enabled
  7. May 10 13:36:48 wyh ntpd[21450]: Listening on interface #3 eth0, fe80::20c:29ff:fed3:9350#123 Enabled
  8. May 10 13:36:48 wyh ntpd[21450]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
  9. May 10 13:36:48 wyh ntpd[21450]: Listening on interface #5 eth0, 192.168.174.141#123 Enabled
  10. May 10 13:36:48 wyh ntpd[21450]: Listening on interface #6 virbr0, 192.168.122.1#123 Enabled
  11. May 10 13:36:48 wyh ntpd[21450]: Listening on routing socket on fd #23 for interface updates
  12. May 10 13:36:48 wyh ntpd[21450]: kernel time sync status 2040
  13. May 10 13:36:48 wyh ntpd[21450]: frequency initialized 0.000 PPM from /var/lib/ntp/drift
  14. May 10 13:36:50 wyh ntpd_initres[21452]: host name not found: 0.rhel.pool.ntp.org
  15. May 10 13:36:50 wyh ntpd_initres[21452]: host name not found: 1.rhel.pool.ntp.org
  16. May 10 13:36:50 wyh ntpd_initres[21452]: host name not found: 2.rhel.pool.ntp.org
  17. May 10 13:36:55 wyh ntpd[21450]: ntpd exiting on signal 15
  18. May 10 13:36:55 wyh ntpd_initres[21452]: parent died before we finished, exiting
  19. May 10 13:40:01 wyh CROND[21513]: (root) CMD (/usr/lib/sa/sa1 1 1)
复制代码
我想问下楼主,Linux下使用哪种调试工具最好查看日志信息了。

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
12 [报告]
发表于 2013-05-10 13:44 |只看该作者
ping 192.168.174.153
通么?

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
13 [报告]
发表于 2013-05-10 13:44 |只看该作者
另外你看192.168.174.153 这个机器的ntp配置允许你同步么?

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
14 [报告]
发表于 2013-05-10 13:46 |只看该作者
你的ntp配置文件有问题。

May 10 13:36:50 wyh ntpd_initres[21452]: host name not found: 0.rhel.pool.ntp.org
May 10 13:36:50 wyh ntpd_initres[21452]: host name not found: 1.rhel.pool.ntp.org
May 10 13:36:50 wyh ntpd_initres[21452]: host name not found: 2.rhel.pool.ntp.org
May 10 13:36:55 wyh ntpd[21450]: ntpd exiting on signal 15
May 10 13:36:55 wyh ntpd_initres[21452]: parent died before we finished, exiting

最后一行只是crontab的一条日志。没别的了。

论坛徽章:
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
15 [报告]
发表于 2013-05-10 16:32 |只看该作者
域名解析出问题了吧.你在ntp服务器测试下dns解析吧

论坛徽章:
0
16 [报告]
发表于 2013-05-13 09:16 |只看该作者
回复 13# wenhq


    能ping通。
    我配置了restrict 192.168.174.0 mask 255.255.255.0 nomodify notrap这条信息是允许192.168.174.153 这个机器的ntp配置同步吧。
    要是还需其他配置,我就不清楚了。

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
17 [报告]
发表于 2013-05-13 09:26 |只看该作者
贴一下你的ntp的配置文件。

论坛徽章:
0
18 [报告]
发表于 2013-05-13 09:38 |只看该作者
  1. # For more information about this file, see the man pages
  2. # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

  3. driftfile /var/lib/ntp/drift

  4. # Permit time synchronization with our time source, but do not
  5. # permit the source to query or modify the service on this system.
  6. restrict default kod nomodify notrap nopeer noquery
  7. #restrict -6 default kod nomodify notrap nopeer noquery

  8. # Permit all access over the loopback interface.  This could
  9. # be tightened as well, but to do so would effect some of
  10. # the administrative functions.
  11. restrict 127.0.0.1
  12. restrict -6 ::1

  13. # Hosts on local network are less restricted.
  14. restrict 192.168.174.0 mask 255.255.255.0 nomodify notrap

  15. # Use public servers from the pool.ntp.org project.
  16. # Please consider joining the pool (http://www.pool.ntp.org/join.html).
  17. server 0.rhel.pool.ntp.org iburst
  18. server 1.rhel.pool.ntp.org iburst
  19. server 2.rhel.pool.ntp.org iburst

  20. #broadcast 192.168.1.255 autokey        # broadcast server
  21. #broadcastclient                        # broadcast client
  22. #broadcast 224.0.1.1 autokey            # multicast server
  23. #multicastclient 224.0.1.1              # multicast client
  24. #manycastserver 239.255.254.254         # manycast server
  25. #manycastclient 239.255.254.254 autokey # manycast client

  26. # Undisciplined Local Clock. This is a fake driver intended for backup
  27. # and when no outside source of synchronized time is available.
  28. server 192.168.174.153
  29. fudge   127.127.1.0 stratum 10

  30. # Enable public key cryptography.
  31. #crypto

  32. includefile /etc/ntp/crypto/pw

  33. # Key file containing the keys and key identifiers used when operating
  34. # with symmetric key cryptography.
  35. keys /etc/ntp/keys
  36. # Specify the key identifiers which are trusted.
  37. #trustedkey 4 8 42

  38. # Specify the key identifier to use with the ntpdc utility.
  39. #requestkey 8

  40. # Specify the key identifier to use with the ntpq utility.
  41. #controlkey 8

  42. # Enable writing of statistics records.
  43. #statistics clockstats cryptostats loopstats peerstats

复制代码
回复 17# wenhq


   

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
19 [报告]
发表于 2013-05-13 09:49 |只看该作者
server 192.168.174.153 ##改成你本地的ntpserver IP
这个IP 是你内网的 ntp server 192.168.174.153?
#############################
server 0.rhel.pool.ntp.org iburst

server 1.rhel.pool.ntp.org iburst

server 2.rhel.pool.ntp.org iburst

注释掉这3行。

论坛徽章:
0
20 [报告]
发表于 2013-05-13 12:41 |只看该作者
回复 19# wenhq


    我在虚拟机上实验了,我在IP地址为192.168.174.153的主机上实验作为服务器,所以我就填这个地址啊。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP