- 选中node1来做ntp server,安装ntp服务
apt install ntp - vim /etc/ntp.conf 修改node1的ntp服务的配置文件
新增:
restrict 192.168.56.0 mask 255.255.255.0 # 192.168.56.0指的是要同步的网段为192.168.56.0/24这个网段
server 127.127.1.0
fudge 127.127.1.0 stratum 10 - node1启动ntp服务
systemctl start ntp - node2进行时间同步
ntpdate node1_ip