I am trying to synchronize clocks using ptp4l and phc2sys.
I followed this instructions. Unfortunately, I am seeing clock jumps: In 5 of the 6 servers, clock jumps by 2 hours. In the image, it goes from 9:52 to 11:46.
I am trying to synchronize clocks using ptp4l and phc2sys.
I followed this instructions. Unfortunately, I am seeing clock jumps: In 5 of the 6 servers, clock jumps by 2 hours. In the image, it goes from 9:52 to 11:46.
The issue was arising because of different timestamps on the CPU clock and the NIC. NIC was two hours ahead and caused the time to change for all other systems.
These two commands worked for me:
sudo ptp4l -i <interface> -2
sudo phc2sys -a -rr
-2 IEEE 802.3
-i interface
-a turn on autoconfiguration
-rr synchronize system (realtime) clock and also consider it as a time source
This might not help your specific problems but these are somethings I found out when getting it to work on my system.
We can run ptp4l on multiple interfaces. Use
phc2sys -a -r // Synchronize time automatically according to the current ptp4l state, synchronize the system clock to the remote master.
// use this if you have a grandmaster clock
If you want one ptp4l instance on multiple interfaces (specifying -i twice) they both must be using either software or hardware timestamping, we cannot mix and match.
phc2sys -a -r helped my 3rd computer, cpu2 in this case (Grandmaster -> CPU1 -> CPU2) not be off by 36 seconds from its master.
ptp4l must be running on both the master and slave for the clocks to sync.