linux – NTP服务器架构

前端之家收集整理的这篇文章主要介绍了linux – NTP服务器架构前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个运行多个 Linux机器的虚拟环境,我正在计划如何管理所有的ntp架构.
据我所知,’ntp.conf’文件中有两个服务器是没有用的,客户端应该只有一个或三个以上的ntp服务器,所以我的第一个方法是让一个服务器’server1’指向4个公共服务器,特别是RHEL服务器,然后有其他框’server2’指向server1,而在我指向server2的所有其他Linux服务器之下,但我观察到这种架构有一种奇怪的行为.我已经看到一些服务器在server2和它们之间取消,甚至有时server1和server2也没有完全同步.
我的第一个问题是,为什么会发生这种情况?
然后我想出了另一个架构,它有相同的server1指向公共ntp服务器,然后有三个服务器,’server2′,’server3’和’server4’指向server1,在我指向servers2-4的所有其他机器下面.
这个架构是否有可能改善我所有网络中的同步?
或者同步之间会有相同的性能吗?
什么是最好的架构方法

Edited

这是来自server1的ntpq -p的输出

  1. remote refid st t when poll reach delay offset jitter
  2. =========================================================================
  3. *Time100.Stupi. .PPS. 1 u 317 1024 377 182.786 5.327 3.022
  4. LOCAL(0) .LOCL. 10 l 46h 64 0 0.000 0.000 0.000

在这里它的ntp.conf:

  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.  
  4. driftfile /var/lib/ntp/drift
  5.  
  6. # Permit time synchronization with our time source,but do not
  7. # permit the source to query or modify the service on this system.
  8. restrict default kod nomodify notrap nopeer noquery
  9. restrict -6 default kod nomodify notrap nopeer noquery
  10.  
  11. # Permit all access over the loopback interface. This could
  12. # be tightened as well,but to do so would effect some of
  13. # the administrative functions.
  14. restrict 127.0.0.1
  15. restrict -6 ::1
  16.  
  17. # Hosts on local network are less restricted.
  18. #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
  19.  
  20. # Use public servers from the pool.ntp.org project.
  21. # Please consider joining the pool (http://www.pool.ntp.org/join.html).
  22. server 0.rhel.pool.ntp.org iburst
  23. server 1.rhel.pool.ntp.org iburst
  24. server 2.rhel.pool.ntp.org iburst
  25. server 3.rhel.pool.ntp.org iburst
  26. #broadcast 192.168.1.255 autokey # broadcast server
  27. #broadcastclient # broadcast client
  28. #broadcast 224.0.1.1 autokey # multicast server
  29. #multicastclient 224.0.1.1 # multicast client
  30. #manycastserver 239.255.254.254 # manycast server
  31. #manycastclient 239.255.254.254 autokey # manycast client
  32.  
  33. # Enable public key cryptography.
  34. #crypto
  35.  
  36. includefile /etc/ntp/crypto/pw
  37.  
  38. # Key file containing the keys and key identifiers used when operating
  39. # with symmetric key cryptography.
  40. keys /etc/ntp/keys
  41.  
  42. # Specify the key identifiers which are trusted.
  43. #trustedkey 4 8 42
  44.  
  45. # Specify the key identifier to use with the ntpdc utility.
  46. #requestkey 8
  47.  
  48. # Specify the key identifier to use with the ntpq utility.
  49. #controlkey 8
  50.  
  51. # Enable writing of statistics records.
  52. statistics clockstats cryptostats loopstats peerstats sysstats rawstats
  53.  
  54. ### Added by IPA Installer ###
  55. server 127.127.1.0
  56. fudge 127.127.1.0 stratum 10

以下是三个客户的输出

  1. remote refid st t when poll reach delay offset jitter
  2. ==============================================================================
  3. *server1 172.16.29.21 3 u 1 64 1 1.090 -0.138 0.036
  4.  
  5.  
  6. remote refid st t when poll reach delay offset jitter
  7. ==============================================================================
  8. *server1 172.16.29.21 3 u 1035 1024 377 1.117 -1.943 0.530
  9.  
  10.  
  11. remote refid st t when poll reach delay offset jitter
  12. ==============================================================================
  13. *server1 172.16.29.21 3 u 32 64 1 0.902 1.788 0.140

解决方法

根据您的环境中保持关键时间的重要性,您可能不希望server1成为单点故障.如果您必须将其脱机以进行维护或维修很长一段时间,其对等方将停止同步.从那里开始都是下坡.

为什么不将server1,server2,server3,server4同步到4个或5个Internet对等体.那么,您的内部网络可以参考这些系统吗?

传统观点认为,3是你达到法定人数所需要的,但你需要容忍至少有一个人被确定为假人或离线.

请参阅; 5.3.3. Upstream Time Server Quantity

此外,您还提到了当前配置的怪异和问题.有助于查看相关主机的ntpq -p输出.

猜你在找的Linux相关文章