在旧系统中,ntpdate仍然可用,我可以查询NTP-Server,而无需设置
ntpdate -q pool.ntp.org
并得到了例如:
server 213.239.239.164, stratum 2, offset -0.001191, delay 0.06012
server 185.220.101.76, stratum 3, offset 0.001658, delay 0.06416
server 185.220.101.31, stratum 3, offset -0.002385, delay 0.06377
server 159.69.144.253, stratum 2, offset -0.000134, delay 0.05711因此,我看到NTP-服务器运行良好,可以使用。
在较新的系统( ntpd正在运行,ntpq可用)上,我尝试了。
ntpq -p pool.ntp.org
但是它响应timed out, nothing received,我做错了什么,ntpq命令的正确参数是什么,以查看ntpq服务器正在工作,并为我的系统提供了一个可以使用的良好的时基?
发布于 2020-02-04 12:49:45
与此同时,我找到了我自己的问题的答案:
sntp -t 1 pool.ntp.org
在没有ntpdate的情况下工作,并且可以在ntp-包中使用。它非常快速,允许检查外部NTP-服务器.在缺点上,它总是更改系统时间,因此它不仅显示日期/时间。
发布于 2020-02-03 18:01:38
有些新系统使用timesyncd,没有客户端,但可以使用timedatectl $ timedatectl Local time: Mon 2020-02-03 18:56:37 CET Universal time: Mon 2020-02-03 17:56:37 UTC RTC time: Mon 2020-02-03 17:56:37 Time zone: Europe/Amsterdam (CET, +0100) System clock synchronized: yes NTP service: active RTC in local TZ: no。
其他人有时间c,您可以使用
chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* schnitzel.team 2 8 377 107 +989us[+1030us] +/- 12ms
^+ dns02.wsrs.net 2 8 377 109 -877us[ -836us] +/- 29ms
^+ mon2.hostin.cc 2 7 377 108 +1541us[+1583us] +/- 44ms
^- 51-15-20-83.rev.poneytel> 2 8 377 110 -8564us[-8522us] +/- 176ms发布于 2020-02-04 13:06:07
ntpdate -q pool.ntp.org
对我来说,我只告诉pool.ntp.org (现实中的一个组)是怎样的(即它们的形状以及它们是否可以到达)。
对于本地主机本身,我将使用ntpq -p,因此对于我自己的机器:
stefan@asus:~$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+gbg1.ntp.se .PPS. 1 u 451 1024 377 10.221 -0.323 0.149
*gbg2.ntp.se .PPS. 1 u 500 1024 377 10.250 -0.298 0.133
-sth2.ntp.se .PPS. 1 u 352 1024 377 22.984 1.020 10.616
+mmo1.ntp.se .PPS. 1 u 193 1024 377 15.313 0.225 0.135这告诉我,这台机器(华硕)现在更喜欢gbg2.ntp.se,但gbg1和mmo1是替代品。
由于抖动,sth2.ntp.se不是首选的。是的,我的机器本身就是2层(gbg1,gbg2和mmo1是第1层)。
ntpq -p告诉谁是命名计算机的对等方(在你的例子中,池计算机可能不会告诉你这一点)。单靠ntpq -p就能知道谁是本地计算机的同侪(S),更有趣的是。
而且,不,我不认为时间同步对于服务器来说足够好!!如果对一台计算机进行同步处理,则为软管!
https://serverfault.com/questions/1001582
复制相似问题