]> git.proxmox.com Git - pve-docs.git/blame - system-timesync.adoc
do not set toplevel attribute for default env
[pve-docs.git] / system-timesync.adoc
CommitLineData
4b985658
FG
1Time Synchronization
2--------------------
3include::attributes.txt[]
1a2d79d9
DM
4ifdef::wiki[]
5:pve-toplevel:
6endif::wiki[]
4b985658
FG
7
8The {pve} cluster stack itself relies heavily on the fact that all
9the nodes have precisely synchronized time. Some other components,
10like Ceph, also refuse to work properly if the local time on nodes is
11not in sync.
12
13Time synchronization between nodes can be achieved with the ``Network
14Time Protocol'' (`NTP`). {pve} uses `systemd-timesyncd` as NTP client
15by default, preconfigured to use a set of public servers. This setup
16works out of the box in most cases.
17
18
19Using Custom NTP Servers
20~~~~~~~~~~~~~~~~~~~~~~~~
21
22In some cases, it might be desired to not use the default NTP
23servers. For example, if your {pve} nodes do not have access to the
24public internet (e.g., because of restrictive firewall rules), you
25need to setup local NTP servers and tell `systemd-timesyncd` to use
26them:
27
28.File `/etc/systemd/timesyncd.conf`
29----
30[Time]
31Servers=ntp1.example.com ntp2.example.com ntp3.example.com ntp4.example.com
32----
33
34After restarting the synchronization service (`systemctl restart
35systemd-timesyncd`) you should verify that your newly configured NTP
36servers are used by checking the journal (`journalctl --since -1h -u
37systemd-timesyncd`):
38
39----
40...
41Oct 07 14:58:36 node1 systemd[1]: Stopping Network Time Synchronization...
42Oct 07 14:58:36 node1 systemd[1]: Starting Network Time Synchronization...
43Oct 07 14:58:36 node1 systemd[1]: Started Network Time Synchronization.
44Oct 07 14:58:36 node1 systemd-timesyncd[13514]: Using NTP server 10.0.0.1:123 (ntp1.example.com).
45Oct 07 14:58:36 nora systemd-timesyncd[13514]: interval/delta/delay/jitter/drift 64s/-0.002s/0.020s/0.000s/-31ppm
46...
47----