dnf install -y chrony
/etc/chrony.conf. The following describes the common configuration items./etc/chrony.conf and modify the server configuration item:vi /etc/chrony.conf
# NTP Server (Tencent Cloud Internal)server time1.tencentyun.com iburstserver time2.tencentyun.com iburstserver time3.tencentyun.com iburstserver time4.tencentyun.com iburstserver time5.tencentyun.com iburst# Tencent Public Network NTP Serverserver ntp.tencent.com iburstserver ntp1.tencent.com iburstserver ntp2.tencent.com iburstserver ntp3.tencent.com iburst# Public NTP Server (Backup)server cn.pool.ntp.org iburst
# NTP Server (Tencent Cloud Internal)server time1.tencentyun.com iburstserver time2.tencentyun.com iburstserver time3.tencentyun.com iburstserver time4.tencentyun.com iburstserver time5.tencentyun.com iburst# Tencent Public Network NTP Serverserver ntp.tencent.com iburstserver ntp1.tencent.com iburstserver ntp2.tencent.com iburstserver ntp3.tencent.com iburst# Clock Drift Log Filedriftfile /var/lib/chrony/drift# Allow Step Time Correction (Jump directly if the offset exceeds 1 second in the first 3 synchronizations)makestep 1.0 3# Write the System Clock Back to the Hardware Clockrtcsync# Obtain the TAI-UTC Offset from the System Time Zone Databaseleapsectz right/UTC# Log Directorylogdir /var/log/chrony
Parameter | Description |
server <address> iburst | Specifies the NTP server, and iburst accelerates the initial synchronization (the interval between the first four requests is shortened to 2 seconds). |
driftfile <path> | File that records the clock drift compensation value. Default: /var/lib/chrony/drift |
makestep 1.0 3 | Steps the clock directly when the offset exceeds 1 second in the first three synchronizations. |
rtcsync | Synchronizes the system clock to the hardware clock (RTC). |
logdir <path> | Log directory. Default: /var/log/chrony |
# Start the chronyd service.systemctl start chronyd# Enable autostart on boot.systemctl enable chronyd# Check the service status.systemctl status chronyd# Restart the service (after modifying the configuration)systemctl restart chronyd
chronyc tracking
Reference ID : A9FE0050 (169.254.0.80)Stratum : 3Ref time (UTC) : Fri Aug 21 07:08:58 2026System time : 0.000010930 seconds fast of NTP timeLast offset : +0.000018760 secondsRMS offset : 0.000018760 secondsFrequency : 23.578 ppm slowResidual freq : -1.007 ppmSkew : 39.788 ppmRoot delay : 0.001493059 secondsRoot dispersion : 0.031474017 secondsUpdate interval : 2.0 secondsLeap status : Normal
chronyc sources -v
MS Name/IP address Stratum Poll Reach LastRx Last sample===============================================================================^+ 169.254.0.79 2 6 77 11 +635us[ +635us] +/- 42ms^+ 169.254.0.80 2 6 77 11 +649us[ +649us] +/- 43ms^+ 169.254.0.81 2 6 77 12 +440us[ +440us] +/- 30ms^+ 169.254.0.82 2 6 77 11 +515us[ +515us] +/- 37ms^* 169.254.0.83 2 6 77 13 +640us[ +879us] +/- 42ms
Flag | Description |
* | Synchronization source currently in use |
+ | Selected standby source |
- | Excluded (not involved in the current synchronization) |
? | Unreachable source |
chronyc sourcestats -v
chronyc activity
200 OK10 sources online0 sources offline0 sources doing burst (return to online)0 sources doing burst (return to offline)0 sources with unknown address
chronyc makestep
journalctl -u chronyd
timedatectl
Local time: Fri 2026-08-21 15:14:24 CSTUniversal time: Fri 2026-08-21 07:14:24 UTCRTC time: Fri 2026-08-21 07:14:24Time zone: Asia/Shanghai (CST, +0800)System clock synchronized: yesNTP service: activeRTC in local TZ: no
timedatectl list-timezones | grep Asia
timedatectl set-timezone Asia/Shanghai
timedatectl set-ntp true
# 1. Confirm that chronyd is running properly.systemctl is-active chronyd# 2. Confirm that the system is synchronized with the NTP server (System time should be less than 1 second).chronyc tracking | grep "System time"# 3. Confirm that the time zone is correct.date
chronyc tracking shows "Not synchronised".# Check chronyd logs to troubleshoot network issues.journalctl -u chronyd -n 50# Test connectivity to the NTP server.ping -c 4 time1.tencentyun.com# Check whether the firewall allows UDP port 123.firewall-cmd --list-all | grep ntp
firewall-cmd --permanent --add-service=ntpfirewall-cmd --reload
# Force synchronization immediately (use with caution on systems that require strong consistency)chronyc makestep# Check the offset.chronyc tracking | grep offset
/etc/chrony.conf, set the makestep parameter to unlimited stepping:# Step the clock whenever the offset exceeds 1 second (unlimited times)makestep 1.0 -1
フィードバック