时间服务器172.31.1.4
客户端:172.31.1.2,172.31.1.3
服务端:
1. 更改/etc/chrony.conf。其中,对于内网环境,必须要启用local stratum 10。因为你需要将本机的时间,给客户端做时间同步。
server 172.31.1.4 iburst
server ntp1.aliyun.com iburst minpoll 4 maxpoll 10
2.重启systemctl restart chronyd
3.查看状态chronyc sources -v,箭头位置必须是符号*才算是正常。
客户端
1. 编辑/etc/chrony.conf
2. 重启systemctl restart chronyd
3. 查看状态chronyc sources -v。箭头位置必须是符号*才算是正常。
4.如下NTP synchronized显示为yes ,就示意已经与时间服务器同步过了。
结束。
附注:国内时间服务器:
最常见、熟知的就是,www.pool.ntp.org/zone/cn
cn.ntp.org.cn #中国
edu.ntp.org.cn #中国教育网
ntp1.aliyun.com #阿里云
ntp2.aliyun.com #阿里云
cn.pool.ntp.org #最常用的国内NTP服务器