How to Set Up Chrony for Precise Time Sync on Rocky Linux Servers
This guide walks through installing, configuring, and verifying Chrony on two Rocky Linux 8.9 servers, showing how to sync with public NTP sources and between servers, including firewall settings and detailed output interpretation.
Chrony Overview
Chrony is an open‑source NTP client/server designed for Unix‑like systems (Linux, BSD, macOS) that provides high‑precision time synchronization with low latency, CPU, and memory usage. It consists of two programs: chronyd (the daemon that adjusts the system clock) and chronyc (the command‑line client for monitoring and configuration).
Test Environment
Two Rocky Linux 8.9 servers (Server1 172.16.0.134/24 and Server2 172.16.0.150/24) are connected to the same network (Net1) with NAT enabled, allowing Internet access.
Installing Chrony
[root@Server1 ~]# rpm -qa | grep chrony
chrony-4.2-1.el8.rocky.1.0.x86_64Chrony is pre‑installed on Rocky Linux 8.9; the command above confirms the package.
Configuring Server1 to Use Public NTP Sources
# vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# pool 2.rocky.pool.ntp.org iburst # comment this line
Server ntp.aliyun.com iburst # Alibaba Cloud NTP
Server time1.cloud.tencent.com iburst # Tencent Cloud NTPAfter editing, restart and enable the daemon:
# systemctl restart chronyd
# systemctl enable chronyd
# systemctl is-active chronyd # should output "active"Verify synchronization status:
# chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 203.107.6.88 2 6 37 63 +49u s[+2956u s] +/- 23ms
^- 106.55.184.199 2 6 127 60 +1891u s[+1891u s] +/- 47msThe output symbols are explained in the following block:
M : mode ("^" server, "=" peer, "#" local clock) S : state ("*" current best, "+" acceptable, "-" rejected, "?" unreachable, "x" false, "~" variable) Other columns show name/IP, stratum, poll interval, reachability, last receipt, and offset details.
Configuring Server2 to Sync from Server1
Edit /etc/chrony.conf on Server2 to point to Server1’s IP:
# vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# pool 2.rocky.pool.ntp.org iburst # comment this line
Server 172.16.0.134 iburst # Server1 as NTP sourceRestart and enable the daemon on Server2:
# systemctl restart chronyd
# systemctl enable chronydOpen the NTP service in the firewall on Server1 (required for Server2 to reach it):
# firewall-cmd --add-service=ntp --permanent
# firewall-cmd --reloadVerification
Run chronyc sources on both servers to confirm that Server2 reports Server1 as its source and that Server1 continues to sync with the public NTP servers.
Key Takeaways
Chrony provides fast, low‑overhead time synchronization suitable for modern Linux distributions.
Configuration is done via /etc/chrony.conf, where public NTP pools or private servers can be specified.
Use chronyc sources and chronyc tracking to monitor synchronization health.
Remember to allow NTP traffic through the firewall when using private NTP sources.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
