[root@yum-server-it-ap01 ~]# chronyc sourcestats -v
210 Number of sources = 1
.- Number of sample points in measurement set.
/ .- Number of residual runs with same sign.
| / .- Length of measurement set (time).
| | / .- Est. clock freq error (ppm).
| | | / .- Est. error in freq.
| | | | / .- Est. offset.
| | | | | | On the -.
| | | | | | samples. \
| | | | | | |
Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev
==============================================================================
10.82.100.81 5 3 71 +0.003 10.482 +109ns 27us
[root@yum-server-it-ap01 ~]# chronyc sources -v
210 Number of sources = 1
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 10.82.100.81 11 6 77 5 +23us[ +116us] +/- 292ms
[root@yum-server-it-ap01 ~]#
timedatectl set-local-rtc 1
timedatectl set-timezone Asia/Shanghai
systemctl restart chronyd.service
chronyc tracking
chronyc -a makestep
timedatectl
Local 本地时间
RTC 硬件时间
Timezone 时区
2.设置时区
timedatectl set-timezone Asia/Shanghai
或者
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cp命令覆盖/etc/localtime时间无法解决
3.是否NTP服务器同步
timedatectl set-ntp yes //yes或者no
4.将硬件时钟调整为与本地时钟一致
timedatectl set-local-rtc 1
硬件时钟默认使用UTC时间,因为硬件时钟不能保存时区和夏令时调整,修改后就无法从硬件时钟中读取出准确标准时间,因此不建议修改。修改后系统会出现下面的警告。
Warning: The RTC is configured to maintain time in the local timezone. This
mode is not fully supported and will create various problems with time
zone changes and daylight saving adjustments. If at all possible use
RTC in UTC, by calling ‘timedatectl set-local-rtc 0’。