linux内网时钟源管理(使用时间服务chrony)
时钟源服务器解决:chronyd
安装服务端
说明
时钟服务器:192.168.19.69
此处选择chrony作为服务端,都是ntp协议的实现,包括chronyd和chronyc
端口:默认使用udp 123服务端之间通讯,323端口客户端与服务端通讯
centos7.4+、almalinux8.6+默认已安装的服务
既可以是服务端也可以是客户端
更精确的时间控制
linux环境(免安装)
确定版本:使用3.4
chrony-3.4-1.el7.x86_64.rpm #保持版本一致,能减少同步问题
chronyd -v
确定安装环境
#因centos早期版本可能ntpd和chrony共存,或其他人安装了ntpd,需要关闭ntpd
netstat -anlp|grep 123 #端口是否有占用
netstat -anlp|grep 323 #端口是否有占用
netstat -anlp|grep ntp #ntp服务是否开启
#当前服务器状态,上图刚安装系统后的初始状态,注意时区
timedatectl
说明:
Local time: 二 2022-03-01 00:47:50 CST #当地时间
Universal time: 一 2022-02-28 16:47:50 UTC #伦敦时间
RTC time: 一 2022-02-28 16:47:50 #硬件时间
Time zone: Asia/Shanghai (CST, +0800) #NTP服务
NTP synchronized: no #NTP时间是否启用
RTC in local TZ: no #是否启用RTC硬件时间
【定系统时间计算方式,0表示使用utc时间计算方式,yes为0,no为1】
【timedatectl set-local-rtc 1这个命令控制】
DST active: n/a
不关闭防火墙、但允许123、323端口
#如果没开启防火墙,则不需要配置
firewall-cmd --permanent --add-port=123/udp
firewall-cmd --permanent --add-port=323/udp
firewall-cmd --reload
关闭selinux
setenforce 0 #设置关闭
getenroce #查看状态
详情参考此链接:
https://blog.csdn.net/atzqtzq/article/details/128973362

浙公网安备 33010602011771号