因为供电问题,不同tx2在下电又重新上电以后时间无法保持一致,这样就会有各种问题。
解决办法:主要分为主(提供时间的)从(接收时间的)部分
1}首先说明部署情况,四块tx2的ip地址分别为:
(1)192.168.0.2(以下简称2)
(2)192.168.0.3(以下简称3)
(3)192.168.0.4(以下简称4)
(4)192.168.0.5(以下简称5)
2}2的ntp服务有一些问题,无法开机自动启动。所以主服务器设为3.
3}ntpdate时间同步服务依赖以下四项依赖包:
- libopts25_1%3a5.18.7-3_arm64.deb
- ntp_1%3a4.2.8p4+dfsg-3ubuntu5.9_arm64.deb
- ntpdate_4.2.8p4+dfsg-3ubuntu5_arm64.deb
- sshpass_1.05-1_arm64.deb
3.5} 每个tx2都需要配置一个文件
#sudo gedit /etc/ntp.conf
主节点配置如下:
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerst