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 ~]#
参考链接:
如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮,您的“推荐”将是我最大的写作动力!欢迎各位转载,但是未经作者本人同意,转载文章之后必须在文章页面明显位置给出作者和原文连接,否则保留追究法律责任的权利。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· Vue3状态管理终极指南:Pinia保姆级教程