使用linuxPTP在两台主机之间同步系统时间

使用linuxPTP在两台主机之间同步系统时间

我想使用 linuxptp 在两台机器之间设置高精度系统时间同步。

在第一台主机上:

  • 通过连接到互联网的接口使用 NTP 定期同步系统时间
  • 在第二个界面 ( eno2) 上,我运行ptp4l -i eno2 -S -P -4 -m

在第二台主机上:

  • enp0s31f6连接到eno2第一台主机的接口上,我运行ptp4l -s -i enp0s31f6 -S -P -4 -m

但是,在第二台主机上,ptp4l不会同步系统时间:

ptp4l[1024.042]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1024.047]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[1024.793]: port 1: new foreign master 525400.fffe.cc6c9a-1
ptp4l[1028.792]: selected best master clock 525400.fffe.cc6c9a
ptp4l[1028.792]: foreign master not using PTP timescale
ptp4l[1028.792]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[1030.792]: master offset -1217822064 s0 freq  +34411 path delay    585487
ptp4l[1031.792]: master offset -1217693321 s0 freq  +34411 path delay    456366
ptp4l[1032.793]: master offset -1217396626 s0 freq  +34411 path delay    456366
ptp4l[1033.793]: master offset -1217375833 s0 freq  +34411 path delay    389459
ptp4l[1034.792]: master offset -1217740750 s0 freq  +34411 path delay    389459
ptp4l[1035.794]: master offset -608727349 s0 freq  +34411 path delay    374835
ptp4l[1036.793]: master offset -608893145 s0 freq  +34411 path delay    389459
ptp4l[1037.792]: master offset -609164618 s0 freq  +34411 path delay    389459
ptp4l[1038.793]: master offset      27325 s0 freq  +34411 path delay    374835
ptp4l[1039.792]: master offset     -32658 s0 freq  +34411 path delay    367815
ptp4l[1040.793]: master offset    -114491 s0 freq  +34411 path delay    367815
ptp4l[1041.793]: master offset     181711 s0 freq  +34411 path delay    358661
ptp4l[1042.793]: master offset      65535 s0 freq  +34411 path delay    358661
ptp4l[1043.793]: master offset     -69744 s0 freq  +34411 path delay    366265
ptp4l[1044.794]: master offset     248163 s0 freq  +34411 path delay    350007
ptp4l[1045.794]: master offset     -25172 s1 freq +75113179 path delay    350007
ptp4l[1046.718]: master offset  -75276446 s2 freq +67510258 path delay    350007
ptp4l[1046.718]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[1047.653]: master offset -142323559 s2 freq +60663223 path delay    350007
ptp4l[1048.592]: master offset -203217301 s2 freq +54370632 path delay    350007
[...]
ptp4l[1062.203]: master offset -596973889 s2 freq +8426740 path delay   2862004
ptp4l[1063.193]: master offset -605906062 s0 freq +8426740 path delay   2862004
ptp4l[1063.193]: port 1: SLAVE to UNCALIBRATED on SYNCHRONIZATION_FAULT
[...]

任何想法?

答案1

发现问题原因:与后台 ntp 更新冲突...

必须在客户端禁用 NTP(在这种情况下,时间更新由 PTP 客户端执行)。

相关内容