1、服务器端安装
1.1、安装chrony时间同步服务器
wget http://www.rpmfind.net/linux/centos/7.8.2003/os/x86_64/Packages/chrony-3.4-1.el7.x86_64.rpm
rpm -ivh chrony-3.4-1.el7.x86_64.rpm
或 yum install -y chrony
systemctl start chronyd
systemctl status chronyd
1.2、修改配置文件
vi /etc/chrony.conf
server news.neu.edu.cn iburst
server ntp.sjtu.edu.cn iburst
allow 192.168.100.0/24
1.3、重启服务
systemctl restart chronyd
systemctl enable chronyd
2、客户端安装
2.1、安装chrony时间同步服务器
wget http://www.rpmfind.net/linux/centos/7.8.2003/os/x86_64/Packages/chrony-3.4-1.el7.x86_64.rpm wget http://rpmfind.net/linux/centos/7.8.2003/os/x86_64/Packages/libseccomp-2.3.1-4.el7.x86_64.rpm
wget http://www.rpmfind.net/linux/centos/7.8.2003/os/x86_64/Packages/ntpdate-4.2.6p5-29.el7.centos.x86_64.rpm
rpm -ivh libseccomp-2.3.1-4.el7.x86_64.rpm
rpm -ivh chrony-3.4-1.el7.x86_64.rpm
rpm -ivh ntpdate-4.2.6p5-29.el7.centos.x86_64.rpm
或 yum install -y chrony ntpdate
2.2、修改配置文件
vi /etc/chrony.conf
server 192.168.200.18 iburst #chrony服务器ip地址
2.3、重启服务
systemctl restart chronyd
systemctl enable chronyd
chronyc sources
clock -w
2.4、同步服务器时间
ntpdate 192.168.200.18