CentOS8系统时间同步解决方法

装了新的CentOS8,才发现有很多原来使用的工具在新版本中已经被其他工具替代,今天把常规的系统时间同步问题解决一下,CentOS7及以下的都是采用NTP来解决

找了一下方法,原来是使用了另一个工具替代了,记录一下先

[root@kiccleaf home]# yum install -y chrony
                                                                         
Complete!
安装好工具,先启动
[root@kiccleaf home]# systemctl start chronyd
设为系统自动启动
[root@kiccleaf home]# systemctl enable chronyd
编辑一下配置文件
[root@kiccleaf home]# vim /etc/chrony.conf

/etc/chrony.conf配置文件内容:

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#pool 2.centos.pool.ntp.org iburst (这一行注释掉,增加以下两行)
server ntp.aliyun.com iburst
server cn.ntp.org.cn iburst
重新加载配置
[root@kiccleaf home]# systemctl restart chronyd.service
[root@kiccleaf home]# chronyc sources -v
210 Number of sources = 2

  .-- 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               
===============================================================================
^* 203.107.6.88                  2   6     7     2   -188us[+6871us] +/-   24ms
^- 61.177.189.190                3   6    17    19   +663us[ +663us] +/-   97ms

[root@kiccleaf home]# date
Sat Aug 29 16:26:08 CST 2020
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SuperGloo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值