我已经设置Chrony与4个NTP服务器同步(下面的configuration文件)。 当我运行chronyc tracking和chronyc sources ,它看起来像我的机器连接到NTP服务器是不正确的。 我希望看到我在chronyd.conf文件中指定的服务器列表,当我问什么服务器正在跟踪和它使用的是哪些源。
跟踪:
$ chronyc tracking Reference ID : 216.152.240.220 (216.152.240.220) Stratum : 3 Ref time (UTC) : Thu Feb 18 19:05:11 2016 System time : 0.000564536 seconds fast of NTP time Last offset : +0.000280794 seconds RMS offset : 0.000322653 seconds Frequency : 19.616 ppm fast Residual freq : +0.003 ppm Skew : 0.053 ppm Root delay : 0.039604 seconds Root dispersion : 0.000406 seconds Update interval : 1042.6 seconds Leap status : Normal
资料来源:
$ chronyc sources 210 Number of sources = 4 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^+ ntp.newfxlabs.com 2 10 377 754 -415us[ -143us] +/- 31ms ^* 216.152.240.220 2 10 377 221 +1823us[+2104us] +/- 21ms ^- nox.prolixium.com 2 10 273 22 +4137us[+4137us] +/- 93ms ^- triangle.kansas.net 2 10 376 34m -2860us[-2291us] +/- 103ms
configuration文件(除了顶部的服务器部分之外的所有默认值):
$ cat /etc/chrony.conf # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). #server 0.rhel.pool.ntp.org iburst ##server 1.rhel.pool.ntp.org iburst ##server 2.rhel.pool.ntp.org iburst ##server 3.rhel.pool.ntp.org iburst server 0.us.pool.ntp.org server 1.us.pool.ntp.org server 2.us.pool.ntp.org server 3.us.pool.ntp.org # Ignore stratum in source selection. stratumweight 0 # Record the rate at which the system clock gains/losses time. driftfile /var/lib/chrony/drift # Enable kernel RTC synchronization. rtcsync # In first three updates step the system clock instead of slew # if the adjustment is larger than 10 seconds. makestep 10 3 # Allow NTP client access from local network. #allow 192.168/16 # Listen for commands only on localhost. bindcmdaddress 127.0.0.1 bindcmdaddress ::1 # Serve time even if not synchronized to any NTP server. #local stratum 10 keyfile /etc/chrony.keys # Specify the key used as password for chronyc. commandkey 1 # Generate command key if missing. generatecommandkey # Disable logging of client accesses. noclientlog # Send a message to syslog if a clock adjustment is larger than 0.5 seconds. logchange 0.5 logdir /var/log/chrony #log measurements statistics tracking
timedatectl:
$ timedatectl Local time: Thu 2016-02-18 14:13:33 EST Universal time: Thu 2016-02-18 19:13:33 UTC RTC time: Thu 2016-02-18 19:13:33 Time zone: America/New_York (EST, -0500) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 2015-11-01 01:59:59 EDT Sun 2015-11-01 01:00:00 EST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2016-03-13 01:59:59 EST Sun 2016-03-13 03:00:00 EDT
您指定的服务器:
server 0.us.pool.ntp.org server 1.us.pool.ntp.org server 2.us.pool.ntp.org server 3.us.pool.ntp.org
正如名称所暗示的那样。 当您查找其中一个名称时,您可能会获得美国数百个公共NTP服务器中的任何一个(在世界范围内有数千个,如果您select其他一些国家/地区),那么这些服务器就是该池的一部分。 这些都是通过循环法提供的。
当您查看chronyc sources ,您会看到池中使用的实际服务器。
也许你正在通过名称ping池,并且认为你在响应中看到的IP地址是你在源命令的响应中应该看到的相同的IP地址。
几分钟后再次ping池,你会看到一个不同的IP地址,因为它是一个池。
不要担心,它应该可以工作,只需要一些时间来同步。