Linux Labs

Inside the system: resources, kernel, processes / Stage 11 of 12 · step 6 of 7

The clocks of two machines drift apart

medium ~25 min
Not running Starting usually ~20 s
Report a problem

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

  1. chrony on node1 takes its time from node2: in chronyc sources node2 is the selected source (^*), and chronyc tracking shows Leap status : Normal.
  2. The clock of node1 differs from node2 by less than 1 second — right now.
  3. The setting lives in the chrony files, and the service starts at boot: after sudo systemctl restart chrony node1 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.
  • chrony keeps 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. What chrony itself thinks about the time — chronyc sources and chronyc tracking.

Visible only to you. Saved as you type.

All notes

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

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…