大网数据广告活动
服务器运维问答

ntpd -q lists no servers

· 52CE 我爱测

I am trying to set up ntpd on my servers, so that their clocks are kept in sync. I am running Ubuntu 16.04. I have followed these instructions , and everything seems fine until the end. It's now a while later and the output of ti…

问题原文

原帖链接 · user31415629 · CC BY-SA 4.0

I am trying to set up ntpd on my servers, so that their clocks are kept in sync. I am running Ubuntu 16.04. I have followed these instructions, and everything seems fine until the end. It's now a while later and the output of timedatectl looks like:

      Local time: Thu 2018-06-14 08:41:32 UTC
  Universal time: Thu 2018-06-14 08:41:32 UTC
        RTC time: Thu 2018-06-14 08:41:05
       Time zone: Etc/UTC (UTC, +0000)
 Network time on: no
NTP synchronized: yes
 RTC in local TZ: no

and the output of ntpq -p is:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 ntp.ubuntu.com  .POOL.          16 p    -   64    0    0.000    0.000   0.000

I have configured my AWS security groups so that UDP is open to 0.0.0.0/0 on port 123. All outgoing connections are allowed from these servers anyway.

nmap -sU -p 123 reports:

PORT    STATE         SERVICE
123/udp open|filtered ntp

iptables -L -n -v reports:

Chain INPUT (policy ACCEPT 860K packets, 1119M bytes)
 pkts bytes target     prot opt in     out     source               destination
 1206  140K f2b-sshd   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 573K packets, 460M bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain f2b-sshd (1 references)
 pkts bytes target     prot opt in     out     source               destination
 1206  140K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

I haven't modified the default ntp config at all.

How can I figure out why ntp isn't updating?

已采纳解答

原帖链接 · MadHatter · CC BY-SA 4.0

You're fairly confident that it isn't a firewall issue. I have my reservations, but you've followed Amazon's guide to setting up chrony with Amazon's servers, and it's working.

An interesting experiment would be to try setting up ntpd with those same servers, or to point chrony at external servers instead. That would tell us for sure whether the issue is some kind of hard-to-find firewall blocking NTP to servers which aren't internal to Amazon, or if it really is a chrony vs. ntpd issue.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-06-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。