为了检查是否 chrony 已经同步,我们可以使用下面展示的 tracking 命令。
$ chronyc tracking Reference ID : 6A0ABAC8 (t1.time.sg3.yahoo.com) Stratum : 3 Ref time (UTC) : Wed Oct 17 11:48:51 2018 System time : 0.000984587 seconds slow of NTP time Last offset : -0.000912981 seconds RMS offset : 0.007983995 seconds Frequency : 23.704 ppm slow Residual freq : +0.006 ppm Skew : 1.734 ppm Root delay : 0.089718960 seconds Root dispersion : 0.008760406 seconds Update interval : 515.1 seconds Leap status : Normal
我们可以使用命令确认现在 chrony 使用的时间源:
$ chronyc sources 210 Number of sources = 8 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^- chilipepper.canonical.com 2 10 377 296 +102ms[ +104ms] +/- 279ms ^- golem.canonical.com 2 10 377 302 +105ms[ +107ms] +/- 290ms ^+ pugot.canonical.com 2 10 377 297 +36ms[ +38ms] +/- 238ms ^- alphyn.canonical.com 2 10 377 279 -43ms[ -42ms] +/- 238ms ^- dadns.cdnetworks.co.kr 2 10 377 1070 +40ms[ +42ms] +/- 314ms ^* t1.time.sg3.yahoo.com 2 10 377 169 -13ms[ -11ms] +/- 80ms ^+ sin1.m-d.net 2 10 275 567 -9633us[-7826us] +/- 115ms ^- ns2.pulsation.fr 2 10 377 311 -75ms[ -73ms] +/- 250ms
chronyc 工具可以对每个源进行统计,比如使用 sourcestats 命令获得漂移速率和进行偏移估计。
$ chronyc sourcestats 210 Number of sources = 8 Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev ============================================================================== chilipepper.canonical.com 32 16 89m +6.293 14.345 +30ms 24ms golem.canonical.com 32 17 89m +0.312 18.887 +20ms 33ms pugot.canonical.com 32 18 89m +0.281 11.237 +3307us 23ms alphyn.canonical.com 31 20 88m -4.087 8.910 -58ms 17ms dadns.cdnetworks.co.kr 29 16 76m -1.094 9.895 -83ms 14ms t1.time.sg3.yahoo.com 32 16 91m +0.153 1.952 +2835us 4044us sin1.m-d.net 29 13 83m +0.049 6.060 -8466us 9940us ns2.pulsation.fr 32 17 88m +0.784 9.834 -62ms 22ms
如果你的系统没有连接到互联网,你需要告知 Chrony 系统没有连接到 互联网。为了这样做,运行:
$ sudo chronyc offline [sudo] password for sk: 200 OK
为了确认你的 NTP 源的状态,只需要运行:
$ chronyc activity 200 OK 0 sources online 8 sources offline 0 sources doing burst (return to online) 0 sources doing burst (return to offline) 0 sources with unknown address
可以看到,我的所有源此时都是离线状态。
一旦你连接到互联网,只需要使用命令告知 Chrony 你的系统已经回到在线状态:
$ sudo chronyc online 200 OK
为了查看 NTP 源的状态,运行:
$ chronyc activity 200 OK 8 sources online 0 sources offline 0 sources doing burst (return to online) 0 sources doing burst (return to offline) 0 sources with unknown address
(编辑:ASP站长网)
|