1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - Linux系统 - centos - 正文

君子好学,自强不息!

CentOS8系统中,原有的时间同步服务 ntp/ntpdate服务已经无法使用,使用yum安装,提示已不存在。
之前的版本:yum install -y ntp
centos8:yum -y install chrony

此时临时同步时间方法:chronyd -q ‘server ntp.ntsc.ac.cn iburst’ #时间服务器可以自行选择,这里选择国家授时中心时间

查看时间服务器的同步列表:

[root@k8s-node1 ~]# chronyc -n sources -v 
210 Number of sources = 15

  .-- 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               
===============================================================================
^* 100.100.61.88                 1   7   377    13   +215us[ +195us] +/-   10ms
^+ 203.107.6.88                  2   7   377    26  +3224us[+3203us] +/-   15ms
^+ 120.25.115.20                 2   7   377    76  -1827us[-1847us] +/-   16ms
^? 10.143.33.49                  0   8     0     -     +0ns[   +0ns] +/-    0ns
^+ 100.100.3.1                   2   7   377    25   +449us[ +429us] +/- 3618us
^+ 100.100.3.2                   2   7   377    25   -450us[ -470us] +/- 4022us
^- 100.100.3.3                   2   7    76   138   +732us[ +712us] +/- 3567us
^? 10.143.33.50                  0   8     0     -     +0ns[   +0ns] +/-    0ns
^? 10.143.33.51                  0   8     0     -     +0ns[   +0ns] +/-    0ns
^? 10.143.0.44                   0   8     0     -     +0ns[   +0ns] +/-    0ns
^? 10.143.0.45                   0   8     0     -     +0ns[   +0ns] +/-    0ns
^? 10.143.0.46                   0   8     0     -     +0ns[   +0ns] +/-    0ns
^+ 100.100.5.1                   2   7   377    26  -1242us[-1262us] +/- 5227us
^- 100.100.5.2                   2   6   377    57    -71us[  -92us] +/- 3754us
^+ 100.100.5.3                   2   7   377    26   +447us[ +427us] +/- 4117us
[root@k8s-node1 ~]# 

查看时间同步状态:

[root@k8s-node1 ~]# chronyc tracking
Reference ID    : 64643D58 (100.100.61.88)
Stratum         : 2
Ref time (UTC)  : Mon Jan 03 06:22:54 2022
System time     : 0.000090569 seconds slow of NTP time
Last offset     : -0.000020286 seconds
RMS offset      : 0.000265076 seconds
Frequency       : 5.671 ppm slow
Residual freq   : -0.000 ppm
Skew            : 0.018 ppm
Root delay      : 0.000143060 seconds
Root dispersion : 0.010342887 seconds
Update interval : 128.1 seconds
Leap status     : Normal
[root@k8s-node1 ~]# 

查看时间状态:

[root@k8s-node1 ~]# timedatectl status
               Local time: Mon 2022-01-03 14:25:44 CST
           Universal time: Mon 2022-01-03 06:25:44 UTC
                 RTC time: Mon 2022-01-03 14:25:43
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.
[root@k8s-node1 ~]# 

参考链接:

  • CentOS8 同步时间chrony ntpdate已无法使用
  • centos 设置时间和时区

本文来源:1818IP

本文地址:https://www.1818ip.com/post/32520.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。