e.g. 服务端IP:192.168.2.25 客户端IP:192.168.2.26
1.chrony服务端、客户端 IP是否相通;
2.25 2.26互通
2.chrony客户端 配置文件 server ip为服务端
服务端 /etc/chrony.conf,ip为服务端ip
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.2.25 iburst
客户端 /etc/chrony.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.2.25 iburst
3.chrony服务端 配置文件是否添加客户端所在IP 网段;
修改服务端配置文件 vi /etc/chrony.conf
#Allow NTP client access from local network
#allow 192.168.0.0/16
allow 192.168.2.0/24 #添加客户端所在机器IP网段
配置完成后,重启服务端、客户端
systemctl restart chronyd
4.chrony服务端、客户端 版本是否一致;【chrony各版本之间差异很大,确保版本一致】
查看版本是否一致
chronyc -v
以上操作全部完成,查看是否同步成功
[root@bogon ~]# chronyc sources -v
210 Number of sources = 1
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 192.168.2.25 11 8 377 217 -18us[ -30us] +/- 522ms
说明:
^* #已同步
^? #未同步
192.168.2.25 #时间服务器IP