免费注册 查看新帖 |

Chinaunix

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

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

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-05-09 11:10 |显示全部楼层 |倒序浏览


    RHEL6.3上NTP服务如何配置???

论坛徽章:
0
2 [报告]
发表于 2013-05-09 13:13 |显示全部楼层
回复 2# wupenhu


    我配置了好多次都没成功。查找了好多资料,配置都挺简单,我做了就是没结果。

论坛徽章:
0
3 [报告]
发表于 2013-05-10 09:17 |显示全部楼层
回复 4# chenyx


    NTP服务就是用来将系统时间与网络时间同步。客户机的时间不会与服务器的时间同步吧??

论坛徽章:
0
4 [报告]
发表于 2013-05-10 13:37 |显示全部楼层
回复 6# chenyx


    我执行这个命令报错了啊,提示如下信息:
[root@wyh ~]# ntpdate 192.168.174.153
10 May 13:35:05 ntpdate[21420]: no server suitable for synchronization found
  我在网上查资料说等5分钟执行就可以了,但是我一直有这个错误提示。

论坛徽章:
0
5 [报告]
发表于 2013-05-10 13:40 |显示全部楼层
回复 7# sirense


   我一般是将防火墙关闭的。后来,我试着开启防火墙,然后添加了NTP服务器的端口123.所以端口是打开了。

论坛徽章:
0
6 [报告]
发表于 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下使用哪种调试工具最好查看日志信息了。

论坛徽章:
0
7 [报告]
发表于 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配置同步吧。
    要是还需其他配置,我就不清楚了。

论坛徽章:
0
8 [报告]
发表于 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


   

论坛徽章:
0
9 [报告]
发表于 2013-05-13 12:41 |显示全部楼层
回复 19# wenhq


    我在虚拟机上实验了,我在IP地址为192.168.174.153的主机上实验作为服务器,所以我就填这个地址啊。

论坛徽章:
0
10 [报告]
发表于 2013-05-14 10:02 |显示全部楼层
回复 21# wenhq


    还是同样的错误。
   ntpdate 192.168.174.153
   14 May 09:53:17 ntpdate[23062]: no server suitable for synchronization found

   NTP服务器中messages日志信息如下:
  1. May 14 09:56:30 localhost ntpd[31468]: ntpd exiting on signal 15
  2. May 14 09:56:30 localhost ntpd[31540]: ntpd 4.2.4p8@1.1612-o Thu Jan 10 15:17:24 UTC 2013 (1)
  3. May 14 09:56:30 localhost ntpd[31541]: precision = 0.430 usec
  4. May 14 09:56:30 localhost ntpd[31541]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
  5. May 14 09:56:30 localhost ntpd[31541]: Listening on interface #1 wildcard, ::#123 Disabled
  6. May 14 09:56:30 localhost ntpd[31541]: Listening on interface #2 lo, ::1#123 Enabled
  7. May 14 09:56:30 localhost ntpd[31541]: Listening on interface #3 eth0, fe80::20c:29ff:fe6f:4d56#123 Enabled
  8. May 14 09:56:30 localhost ntpd[31541]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
  9. May 14 09:56:30 localhost ntpd[31541]: Listening on interface #5 eth0, 192.168.174.157#123 Enabled
  10. May 14 09:56:30 localhost ntpd[31541]: Listening on interface #6 virbr0, 192.168.122.1#123 Enabled
  11. May 14 09:56:30 localhost ntpd[31541]: Listening on routing socket on fd #23 for interface updates
  12. May 14 09:56:30 localhost ntpd[31541]: kernel time sync status 2040
  13. May 14 09:56:30 localhost ntpd[31541]: frequency initialized 23.467 PPM from /var/lib/ntp/drift
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP