I have a (most of the time) isolated network consisting of several computers.
computer 0 -- external NTP server / switch -- computer 1 -- external NTP server \ computer n -- external NTP server
Only a small subset of the connections in the above graph may be available at any point in time. Especially the connection to an external NTP server wont be available most of the time.
How can I use chrony to keep all the computers in sync without explicit client/server roles?
- At any given point in time, only a subset of the computers might be up and running. They should be able to get and stay in sync. If another computer is started, it should be synchronized as well. The absolute time is not important (as long as the error is in the magnitude of some seconds / few minutes). What is important is that all the computers in the network are in sync.
- Sporadically any of the computers might be connected to the internet and should be able to get the correct absolute time from an external NTP server and distribute that time in the local network.
I thought about configuring each computer on the network with an external NTP server (initially marked as offline) and then listing all computers as peers of each other. Is this the right way to go? I could not find any information on what happens if there are only NTP peers in a network without a reachable NTP server. Will the clocks converge to a sensible time or might this configuration become unstable so that the overall drift might be even worse than the worst hardware-clock drift of a single computer in the network?
To underline my idea for an appropriate chrony configuration: Is the following approach a good idea?
/etc/chrony/chrony.conf on computer 0:
pool external.ntp.pool offline peer computer_1 peer computer_2 peer computer_n local stratum 10
/etc/chrony/chrony.conf on computer 1:
pool external.ntp.pool offline peer computer_0 peer computer_2 peer computer_n local stratum 10
And so on ...