]> git.proxmox.com Git - pve-docs.git/blob - system-timesync.adoc
storage: pbs: document port option
[pve-docs.git] / system-timesync.adoc
1 Time Synchronization
2 --------------------
3 ifdef::wiki[]
4 :pve-toplevel:
5 endif::wiki[]
6
7 The {pve} cluster stack itself relies heavily on the fact that all
8 the nodes have precisely synchronized time. Some other components,
9 like Ceph, also won't work properly if the local time on all nodes is
10 not in sync.
11
12 Time synchronization between nodes can be achieved using the ``Network
13 Time Protocol'' (`NTP`). As of {pve} 7, `chrony` is used as the default
14 NTP daemon, while {pve} 6 uses `systemd-timesyncd`. Both come preconfigured to
15 use a set of public servers.
16
17 IMPORTANT: If you upgrade your system to {pve} 7, it is recommended that you
18 manually install either `chrony`, `ntp` or `openntpd`.
19
20 Using Custom NTP Servers
21 ~~~~~~~~~~~~~~~~~~~~~~~~
22
23 In some cases, it might be desired to use non-default NTP
24 servers. For example, if your {pve} nodes do not have access to the
25 public internet due to restrictive firewall rules, you
26 need to set up local NTP servers and tell the NTP daemon to use
27 them.
28
29 For systems using chrony:
30 ^^^^^^^^^^^^^^^^^^^^^^^^^^
31
32 Specify which servers `chrony` should use in `/etc/chrony/chrony.conf`:
33
34 ----
35 server ntp1.example.com iburst
36 server ntp2.example.com iburst
37 server ntp3.example.com iburst
38 ----
39
40 Restart `chrony`:
41
42 # systemctl restart chronyd
43
44 Check the journal to confirm that the newly configured NTP servers are being
45 used:
46
47 # journalctl --since -1h -u chrony
48
49 ----
50 ...
51 Aug 26 13:00:09 node1 systemd[1]: Started chrony, an NTP client/server.
52 Aug 26 13:00:15 node1 chronyd[4873]: Selected source 10.0.0.1 (ntp1.example.com)
53 Aug 26 13:00:15 node1 chronyd[4873]: System clock TAI offset set to 37 seconds
54 ...
55 ----
56
57 For systems using systemd-timesyncd:
58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
60 Specify which servers `systemd-timesyncd` should use in
61 `/etc/systemd/timesyncd.conf`:
62
63 ----
64 [Time]
65 NTP=ntp1.example.com ntp2.example.com ntp3.example.com ntp4.example.com
66 ----
67
68 Then, restart the synchronization service (`systemctl restart
69 systemd-timesyncd`), and verify that your newly configured NTP servers are in
70 use by checking the journal (`journalctl --since -1h -u systemd-timesyncd`):
71
72 ----
73 ...
74 Oct 07 14:58:36 node1 systemd[1]: Stopping Network Time Synchronization...
75 Oct 07 14:58:36 node1 systemd[1]: Starting Network Time Synchronization...
76 Oct 07 14:58:36 node1 systemd[1]: Started Network Time Synchronization.
77 Oct 07 14:58:36 node1 systemd-timesyncd[13514]: Using NTP server 10.0.0.1:123 (ntp1.example.com).
78 Oct 07 14:58:36 node1 systemd-timesyncd[13514]: interval/delta/delay/jitter/drift 64s/-0.002s/0.020s/0.000s/-31ppm
79 ...
80 ----