运维笔记 之 centos8chrony时间同步

本文介绍了在CentOS 8中弃用ntpdate,转而使用chrony进行时间同步的方法,包括安装、配置、启动和重启步骤。重点在于如何在`/etc/chrony.conf`中添加阿里云和国内NTP服务器,并确保服务自动运行。
摘要由CSDN通过智能技术生成

centos8时间同步工具

centos8以后不再使用ntpdate作为时间同步工具,改为使用chrony同步时间。

安装chrony

[root@centos8new ~]# yum install chrony -y

启动chrony服务并设置为自动启动

[root@centos8new ~]# systemctl start chronyd
[root@centos8new ~]# systemctl enable chronyd

编辑chrony配置文件

[root@centos8new ~]# vim /etc/chrony.conf
# 注释掉 pool 2.centos.pool.ntp.org.iburst
# 增加如下两行:
server ntp.aliyun.com iburst
server cn.ntp.org.cn iburst
# 修改后文件如下
# pool 2.centos.pool.ntp.org iburst
server ntp.aliyun.com iburst
server cn.ntp.org.cn iburst

重启chrony服务

[root@centos8new ~]# systemctl restart chronyd.service

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值