Step 6 of 7 · lab · 25 min
The clocks of two machines drift apart
The reports from the node1 server are two hours ahead, and the events in the logs of node1 and node2 do not line up. The office time comes from node2. Make the node1 clock follow node2 — now and after the time service restarts.
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 · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 3-
chrony on node1 takes its time from node2 — node2 is the selected source (^* in chronyc sources), Leap status Normal — not done yet
-
The clock of node1 differs from node2 by less than 1 s; the time zone and the clock of node2 are unchanged — not done 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 done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 3-
chrony on node1 takes its time from node2 — node2 is the selected source (^* in chronyc sources), Leap status Normal — not done yet
-
The clock of node1 differs from node2 by less than 1 s; the time zone and the clock of node2 are unchanged — not done 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 done yet
Goals are checked on the machine after every command.