Step 1: Configure time synchronization within the cluster (recommended for offline environments)
If the external NTP source is unstable, designate one node as the “time master node” and have the other nodes synchronize with it, ensuring strict time consistency across the cluster:
1. Choose one node as the time master (e.g., pve01, IP: 192.168.20.101)
bash
Run
# On the master node, edit chrony.conf to allow access from the cluster subnet
vim /etc/chrony/chrony.conf
# Add the following (adjust the cluster subnet as needed, e.g., 192.168.20.0/24)
allow 192.168.20.0/24
local stratum 10 # Use the local clock as the reference when there is no external network
Restart chrony on the master node: systemctl restart chrony.service
2. Have the other nodes (pve02/pve03) synchronize with the master node’s time
bash
Run
# Edit chrony.conf: comment out the public sources and add the master node IP
vim /etc/chrony/chrony.conf
# Comment out the existing public sources and add the following line
server 192.168.20.101 iburst # master node IP
# Restart chrony and force calibration
systemctl restart chrony.service
chronyc makestep
Step 2: Final verification (consistent time across all nodes)
Run the following commands on all nodes to confirm the results:
bash
Run
# 1. Verify the time (deviation ≤ 1 second)
date
# 2. Verify NTP synchronization status (all entries in the S column are *, and the synchronization source is the same)
chronyc -n sources -v
# 3. Verify the system NTP service status (all active)
systemctl status chrony.service







