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 设置时间和时区
相关文章
标签:服务器技术
- •VMware Workstation Pro 16安装CentOS7超详细图文步骤
- •CentOS7下配置使用JumpServer 堡垒机 (图文教程)
- •CentOS安装jdk的几种方法及配置环境变量方式
- •CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
- •解决笔记本安装centos7后无法调节屏幕亮度
- •VMware安装CentOS 8.1(CentOS 8系列可参考)的图文详细教程
- •CentOS7 minimal 最小化安装网络设置过程
- •CentOS7下搭建JumpServer
- •CentOS安装rpm包出现冲突时的解决办法
- •Vmware下CentOS7最小化安装方式