centos7.5 chorny 同步时间

虚拟机:

1、关闭防火墙和selinux

systemctl disable firewalld 

systemctl stop firewalld 


vim /etc/selinux/config 

SELINUX=disabled

2、

server 端: 192.168.30.101

client 端: 192.168.30.102

3、client 与server 端时间:

centos7.5 chorny 同步时间


4、配置server :vim /etc/chrony.conf 

server ntp.aliyun.com iburst

allow 192.168.0.0/16

5、配置client端:vim /etc/chrony.conf

server 192.168.30.101 iburst

6、配置文件需要重启chronyd服务

systemctl restart chronyd;时间同步

centos7.5 chorny 同步时间


7、执行chronyc :^* 192.168.30.101  表示已和服务端同步

centos7.5 chorny 同步时间

8、执行chronyc :192.168.30.102  表示同步的clients 

centos7.5 chorny 同步时间


备注:

[root@centos7 yum.repos.d]#systemctl is-active chronyd     查看服务是否正在运行

active

[root@centos7 yum.repos.d]#systemctl is-enabled  chronyd   查看服务是否开机自启动