centos8上安裝ntpdate報錯-No match for argument: ntpdate


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 ~]# 

參考鏈接:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM