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