首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NTP服务器体系结构

NTP服务器体系结构
EN

Server Fault用户
提问于 2017-08-28 22:31:59
回答 2查看 1.1K关注 0票数 7

我有一个运行多个Linux盒的虚拟环境,我正在计划如何管理所有的ntp体系结构。

据我所知,在“ntp.conf”文件中有两个服务器是没有用的,客户端应该只有一个或三个以上的ntp服务器,因此,我的第一种方法是让一个服务器' server1‘指向4个公共服务器,特别是RHEL服务器,然后让其他方框' server2’指向server1,在所有其他指向server2的服务器下面。

但我观察到了这种建筑的怪异行为。我见过一些服务器在server2和它们之间进行去同步,甚至有时server1和server2没有完全同步。

我的第一个问题是,为什么会这样?

然后,我提出了另一个体系结构,它有相同的server1指向公共ntp服务器,然后有三个服务器,‘server4 2’、'server3‘和'server4’指向server1,在我的所有其他机器下面指向服务器2-4。

  • 这个架构有可能改善我所有网络中的同步吗?
  • 还是同步之间的性能相同?怎样才是最好的建筑方式呢?

编辑过的

下面是来自ntpq -p的server1的输出:

代码语言:javascript
复制
remote          refid      st t when poll reach   delay   offset  jitter
=========================================================================
*Time100.Stupi. .PPS.       1 u  317 1024  377  182.786    5.327   3.022
LOCAL(0)        .LOCL.     10 l  46h   64    0    0.000    0.000   0.000

在这里,它的ntp.conf

代码语言:javascript
复制
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

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

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

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst
#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

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

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

# Enable writing of statistics records.
statistics clockstats cryptostats loopstats peerstats sysstats rawstats

### Added by IPA Installer ###
server 127.127.1.0
fudge 127.127.1.0 stratum 10

以下是三个客户端的输出:

代码语言:javascript
复制
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*server1         172.16.29.21     3 u    1   64    1    1.090   -0.138   0.036


     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*server1         172.16.29.21     3 u 1035 1024  377    1.117   -1.943   0.530


     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*server1         172.16.29.21     3 u   32   64    1    0.902    1.788   0.140
EN

回答 2

Server Fault用户

回答已采纳

发布于 2017-08-28 23:17:32

根据您的环境中保存时间的关键程度,您可能不希望server1成为一个单一的失败点。如果您必须将其脱机维护或修复一段较长的时间,则它的同级将停止同步。从那以后一切都是下坡的。

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

传统观点认为,3才是法定人数所需要的,但你必须容忍至少有一人被认定为伪造者或离线者。

请看;5.3.3.上游时间服务器数量

此外,您还提到了当前配置的奇怪之处和问题。它将有助于查看相关主机的ntpq -p输出。

票数 9
EN

Server Fault用户

发布于 2017-08-29 23:20:21

虽然严格地说2台服务器没用并不是真的,但NTP最佳当前做法RFC (8633)建议至少使用4台。NTP的交集算法不仅取决于服务器数量的仲裁,还取决于服务器返回时间的质量--您无法预测这一点。所以越多越好。拥有多达10个上游NTP服务器没有问题.

正如Aaron提到的,您建议的服务器1-4都应该指向上游NTP服务器,而您的内部系统应该指向所有4个服务器。服务器1-4也可以彼此对等(在对称模式下),但这不是严格要求的。

重要的是要理解为什么您不应该在体系结构的任何一点上通过一个服务器: NTP需要多个服务器来保证准确性,而不仅仅是冗余(请参阅算法描述的NTP文档,这说明了原因)。(无耻的插件:我写了更多关于这个其他地方的文章,包括对建筑的建议。)

票数 6
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/870919

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档