AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 774316
Accepted
auntyellow
auntyellow
Asked: 2016-05-03 05:40:32 +0800 CST2016-05-03 05:40:32 +0800 CST 2016-05-03 05:40:32 +0800 CST

我在哪里可以看到 ntpd 工作状态(日志或消息)

  • 772

在我的服务器中,ntpd 服务已启动,但似乎不起作用。

根据这个(ntpd 日志文件位于哪里,我们如何配置 ntpd 日志文件路径?)和这个(我在哪里可以查找 ntpd 日志?)我什么也找不到:-(

根据 MadHatter 的建议(参见How can I synchronize system time with a NTP server continuous?),我在我的服务器中列出了一些信息:

ntpdate返回:

2 May 21:47:55 ntpdate[47274]: the NTP socket is in use, exiting

ntpq -c as返回:

ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 22393  9614   yes   yes  none  sys.peer   reachable  1
  2 22394  9414   yes   yes  none  candidat   reachable  1
  3 22395  9414   yes   yes  none  candidat   reachable  1

ntpq -c pe返回:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*time5.aliyun.co 10.137.38.86     2 u  157 1024  377   42.869    3.156   0.274
+time7.aliyun.co 10.137.38.86     2 u  402 1024  377   42.997    4.893   0.251
+ntp3.aliyun.com 10.137.38.86     2 u  276 1024  377   38.393    7.159   0.263

我的ntp.conf(# 行未列出)是:

minpoll 4
maxpoll 8
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server ntp1.aliyun.com
server ntp2.aliyun.com
server ntp3.aliyun.com
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys

更新

ntpq -c rv返回:

assID=0 status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg,
version="ntpd [email protected] Tue Nov 29 00:09:12 UTC 2011 (1)",
processor="x86_64", system="Linux/2.6.32-220.4.1.el6.x86_64", leap=00,
stratum=3, precision=-20, rootdelay=42.918, rootdispersion=11.376,
peer=18777, refid=182.92.12.11,
reftime=dad1e8b1.6b42ba77  Mon, May  2 2016 22:54:41.418, poll=8,
clock=dad1e995.5771e298  Mon, May  2 2016 22:58:29.341, state=4,
offset=-0.578, frequency=23.898, jitter=1.845, noise=1.218,
stability=0.223, tai=0

ps 此服务器位于中国成都 (GMT+8)

ntp ntpd ntpdate
  • 1 1 个回答
  • 4694 Views

1 个回答

  • Voted
  1. Best Answer
    MadHatter
    2016-05-03T07:51:17+08:002016-05-03T07:51:17+08:00

    最终的陈述在你的ntpq -c rv输出中,它说

    stratum=3
    

    您已同步;ntpd 正在工作。当您的守护程序报告不是 16 的层时,您知道您已同步。在这种情况下,ntpq -c pe告诉您您的系统对等点(您的守护程序当前正在遵循的时钟)是time5.aliyun.com,也就是ntp1.aliyun.com. 它的层数是 2,而你的层数更高,这是正确的行为。

    ntpdate返回 socket-in-use 错误,因为 socket正在使用中,因为ntpd它正在运行;一旦守护程序运行,您就不能使用ntpdate来改变时钟。这就是为什么ntpdate通常在启动时运行,在守护进程启动之前。

    • 5

相关问题

  • 网络时间服务器的 DHCP 选项

  • 公共 NTP 服务器

  • 时间同步和计划任务

  • 时间漂移

  • Windows Server 无法可靠地同步 NTP 时间

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve