From 7c7ca4a229df300ac7c9091a1dfec3a0bbc5f1fd Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:25 -0400 Subject: [PATCH] Allow inter-cluster orphan NTP sync Due to the requirement of Ceph to have all peer nodes tightly synchronized with each other to come online, PVC nodes need a way to synchronize to each other even in the absence of an external time reference. This is especially prevalent if a set of nodes are left offline for an extended period (>1-2 weeks), since their hardware clocks will drift. If the resulting Internet connectivity is then dependent on a VM, this will cause a catch-22 and the cluster will not properly start. This configuration will accomplish that - if no suitable >6 stratum peers are found, the hosts will enter orphan mode. Since they are now all configured as "peers" with each other, they will collectively decide on one of them to become the source and sync to it. A local stratum 10 fudge is added so that at least one of the nodes can become this source. While this is not an ideal use of NTP, it is by far the cleanest solution to this problem, and does not impact normal functionality when the two configured stratum-2 servers are reachable. --- roles/base/templates/etc/ntp.conf.j2 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/base/templates/etc/ntp.conf.j2 b/roles/base/templates/etc/ntp.conf.j2 index ba9e235..638c6bc 100644 --- a/roles/base/templates/etc/ntp.conf.j2 +++ b/roles/base/templates/etc/ntp.conf.j2 @@ -11,13 +11,18 @@ filegen clockstats file clockstats type day enable disable auth +# Enable orphan mode if cluster cannot connect to the Internet +tos orphan 6 +server 127.0.0.1 +fudge 127.0.0.1 stratum 10 + # NRC public NTP masters server time.nrc.ca iburst server time.chu.nrc.ca iburst # Local PVC cluster {% for host in groups[cluster_group] %} -server {{ host }} iburst +peer {{ host }} {% endfor %} # Provide NTP for others via multicast