mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
137 lines
3.7 KiB
Plaintext
137 lines
3.7 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
//installing/installing_bare_metal/ipi/ipi-install-troubleshooting.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="ipi-install-troubleshooting-ntp-out-of-sync_{context}"]
|
|
|
|
= NTP out of sync
|
|
|
|
The deployment of {product-title} clusters depends on NTP synchronized clocks among the cluster nodes. Without synchronized clocks, the deployment may fail due to clock drift if the time difference is greater than two seconds.
|
|
|
|
.Procedure
|
|
|
|
. Check for differences in the `AGE` of the cluster nodes. For example:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get nodes
|
|
----
|
|
+
|
|
[source,terminal]
|
|
----
|
|
NAME STATUS ROLES AGE VERSION
|
|
master-0.cloud.example.com Ready master 145m v1.34.2
|
|
master-1.cloud.example.com Ready master 135m v1.34.2
|
|
master-2.cloud.example.com Ready master 145m v1.34.2
|
|
worker-2.cloud.example.com Ready worker 100m v1.34.2
|
|
----
|
|
|
|
. Check for inconsistent timing delays due to clock drift. For example:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get bmh -n openshift-machine-api
|
|
----
|
|
+
|
|
[source,terminal]
|
|
----
|
|
master-1 error registering master-1 ipmi://<out_of_band_ip>
|
|
----
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo timedatectl
|
|
----
|
|
+
|
|
[source,terminal]
|
|
----
|
|
Local time: Tue 2020-03-10 18:20:02 UTC
|
|
Universal time: Tue 2020-03-10 18:20:02 UTC
|
|
RTC time: Tue 2020-03-10 18:36:53
|
|
Time zone: UTC (UTC, +0000)
|
|
System clock synchronized: no
|
|
NTP service: active
|
|
RTC in local TZ: no
|
|
----
|
|
|
|
.Addressing clock drift in existing clusters
|
|
|
|
. Create a Butane config file including the contents of the `chrony.conf` file to be delivered to the nodes. In the following example, create `99-master-chrony.bu` to add the file to the control plane nodes. You can modify the file for worker nodes or repeat this procedure for the worker role.
|
|
+
|
|
[NOTE]
|
|
====
|
|
See "Creating machine configs with Butane" for information about Butane.
|
|
====
|
|
+
|
|
[source,yaml,subs="attributes+"]
|
|
----
|
|
variant: openshift
|
|
version: {product-version}.0
|
|
metadata:
|
|
name: 99-master-chrony
|
|
labels:
|
|
machineconfiguration.openshift.io/role: master
|
|
storage:
|
|
files:
|
|
- path: /etc/chrony.conf
|
|
mode: 0644
|
|
overwrite: true
|
|
contents:
|
|
inline: |
|
|
server <NTP_server> iburst <1>
|
|
stratumweight 0
|
|
driftfile /var/lib/chrony/drift
|
|
rtcsync
|
|
makestep 10 3
|
|
bindcmdaddress 127.0.0.1
|
|
bindcmdaddress ::1
|
|
keyfile /etc/chrony.keys
|
|
commandkey 1
|
|
generatecommandkey
|
|
noclientlog
|
|
logchange 0.5
|
|
logdir /var/log/chrony
|
|
----
|
|
<1> Replace `<NTP_server>` with the IP address of the NTP server.
|
|
|
|
. Use Butane to generate a `MachineConfig` object file, `99-master-chrony.yaml`, containing the configuration to be delivered to the nodes:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ butane 99-master-chrony.bu -o 99-master-chrony.yaml
|
|
----
|
|
. Apply the `MachineConfig` object file:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f 99-master-chrony.yaml
|
|
----
|
|
|
|
. Ensure the `System clock synchronized` value is **yes**:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo timedatectl
|
|
----
|
|
+
|
|
[source,terminal]
|
|
----
|
|
Local time: Tue 2020-03-10 19:10:02 UTC
|
|
Universal time: Tue 2020-03-10 19:10:02 UTC
|
|
RTC time: Tue 2020-03-10 19:36:53
|
|
Time zone: UTC (UTC, +0000)
|
|
System clock synchronized: yes
|
|
NTP service: active
|
|
RTC in local TZ: no
|
|
----
|
|
+
|
|
To setup clock synchronization prior to deployment, generate the manifest files and add this file to the `openshift` directory. For example:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ cp chrony-masters.yaml ~/clusterconfigs/openshift/99_masters-chrony-configuration.yaml
|
|
----
|
|
+
|
|
Then, continue to create the cluster.
|