1. 在三台机器上安装 chrony:
yum install chrony
  1. 修改 /etc/chrony.conf 文件,将 server 配置项改为同步主机的 IP 地址,同时添加 local stratum 10 配置项:
server 192.168.9.10 iburst
local stratum 10
  1. 启动 chrony 服务,并将其设置为开机自启:
systemctl start chronyd
systemctl enable chronyd
  1. 确认时间同步已生效:
chronyc sources

应该能够看到同步主机的 IP 地址和当前时间偏差不大于 1 秒。

CentOS 7 时间同步配置 - 使用 chrony 实现三台机器同步到北京时间

原文地址: https://www.cveoy.top/t/topic/m9VT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录