Inside the system: resources, kernel, processes / Stage 11 of 12 · step 6 of 7
The clocks of two machines drift apart
Situation
node1 is the office reports server. Since yesterday the time in its reports has been two hours ahead, and the events of the same request in the logs of node1 and node2 do not line up in time.
The office time comes from node2: it runs the chrony time server, and the clocks of the other
machines should follow it. node1 runs chrony too. The office time zone is Europe/Moscow, and both
machines use it.
node1 is your terminal. Run commands on node2 over SSH: ssh node2 'command', or open a shell there —
ssh node2, and exit to come back. sudo works without a password on both machines.
Task
chronyon node1 takes its time from node2: inchronyc sourcesnode2 is the selected source (^*), andchronyc trackingshowsLeap status : Normal.- The clock of node1 differs from node2 by less than 1 second — right now.
- The setting lives in the
chronyfiles, and the service starts at boot: aftersudo systemctl restart chronynode1 takes its time from node2 again.
Constraints
- Do not change node2: its clock and settings are the office time reference.
- The time zone of both machines stays
Europe/Moscow. chronykeeps the time on node1: do not turn it off or replace it with another program.
There is no internet in the lab — only the network between node1 and node2; everything you need is installed. One line compares the clocks of the two machines:
date; ssh node2 date. Whatchronyitself thinks about the time —chronyc sourcesandchronyc tracking.
Lab goals
0 of 3-
chrony on node1 takes its time from node2 — node2 is the selected source (^* in chronyc sources), Leap status Normal — not checked yet
-
The clock of node1 differs from node2 by less than 1 s; the time zone and the clock of node2 are unchanged — not checked yet
-
The setting lives in the chrony files and chrony is enabled; after sudo systemctl restart chrony node1 takes its time from node2 again — not checked yet