linux学习笔记(27)时间同步,chrony,ntp

发布时间 2023-04-11 21:01:31作者: 郭大侠1

【1】chrony

环境:rhel9

一个服务端,多个客户端,客户端定时同步服务端的时间。

// 安装
yum install -y chrony
systemctl start chronyd
systemctl enable chronyd
systemctl is-enable chronyd


// 配置
vi /etc/chrony.conf
iburst可以增加同步效率,iburst参数加上之后,如果请求失败会连续发送很多次。
  

// 重启生效,并且会立即发起一次同步
systemctl restart chronyd

检验:如下图,有 ^* 开头的行,就表示上次同步的记录。

或随意修改时间后 date -s 2:02,重启 chronyd 服务后再 date 查看时间是否正常。