我们需要再单独去安装 dnf install -y chrony
,只需要配置对应的时间同步服务器即可。
服务器配置
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 10.32.186.70 iburst //添加时间服务器
allow 10.32.186.0/24 //允许指定网段访问此时间服务器,不然只允许本地网络
local stratum 10 //本机不同步其它主机时间
# 设置时区为亚洲/上海
timedatectl set-timezone Asia/Shanghai
# 配置防火墙,也可以设置允许123/UDP端口
firewall-cmd --add-service=ntp
firewall-cmd --runtime-to-permanent
# 重启时间服务 & 查看服务启动状态
systemctl restart chronyd && systemctl status chronyd
# 设置开机自启动
systemctl enable chronyd
客户端配置
客户端配置与服务器端配置基本相同,但是因为客户端不需要接收来自其他主机的时间同步请求,因此不需要指定allow ***
这行。
需要单独安装chrony
服务。
# 我们可以使用`chronyd`命令手动将Linux服务器的时间与远程服务器进行同步。
chronyd -q 'server 10.32.186.70 iburst'
# 配置参数 /etc/chrony.conf
vi /etc/chrony.conf
server 10.32.186.70 iburst
1.本站所有内容只做学习和交流使用。 版权归原作者所有。
2.保证站内提供的所有可下载源码资源(软件等)都是按“原样”提供,本站未做过任何改动;但本网站不保证本站提供的下载资源的准确性、安全性和完整性;同时本网站也不承担用户因使用这些下载资源对自己和他人造成任何形式的损失或伤害。
3.本站部分内容均收集于网络!如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。请联系站长邮箱:admin#ibian.online(#换成@)处理!