一个 NTP 服务器需要的最低规格是什么?我想要像这样配置 NTP 服务器:
1>$ sudo apt install ntp
2>$ cat /etc/ntp.conf
3>$ sudo nano /etc/ntp.conf <add the lines in your config file by using nano>
<make change on ntp file>
##########################
# Leap seconds definition provided by tzdata
leapfile /usr/share/zoneinfo/leap-seconds.list
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# Specify one or more NTP servers.
#server 0.asia.pool.ntp.org iburst
#server 1.asia.pool.ntp.org iburst
#server 2.asia.pool.ntp.org iburst <iburst option for performance>
server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 10
# Use Ubuntu's ntp server as a fallback.
#pool ntp.ubuntu.com
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Needed for adding pool entries
#restrict source notrap nomodify noquery
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
restrict x.x.x.x mask 255.255.255.0 nomodify notrap
#restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
#########################
4>$ sudo systemctl restart ntp < Restart the NTP service for the changes to take effect>
5>$ sudo systemctl status ntp <check status NTP service>
我需要知道 100 台主机或 1000 台主机的 NTP 服务器所需的最低规格是什么?它们之间有区别吗?
答案1
简而言之:如果您有 100 万个客户端,您可以将台式机群中最旧的 PC 回收用作专用 NTP 服务器,而且它们可能会没问题。
NTP 对系统的负载很小,您可以在相当低配置的机器上运行数百万个客户端。请参阅这个帖子以下是我在公共池中运行的虚拟机的一些示例统计数据。它通常每天服务大约 150 万个独立客户端,并且在2016 年 Snapchat 大热潮,它轻松处理了两倍(见下图)。
关于你的帖子还有几点说明:
- 您不应使用本地时钟作为后备。这已被弃用多年;孤儿模式是首选。
- 您不应该只计划提供一个 NTP 服务器。四个是有用的最低工作量。请参阅我的博客文章有关配置的一些具体建议。