Master Chrony: Fast, Precise Time Sync for Linux Servers
This guide explains the fundamentals of time synchronization, why consistent timestamps are critical for distributed systems, and how Chrony provides a faster, more accurate alternative to traditional NTP, including installation, configuration, client usage, and verification steps for Linux environments.
What is Time Synchronization
Time synchronization aligns a host’s clock with an external reference so that all machines in a network share a common time base. Differences in hardware clock rates cause drift, making periodic correction necessary.
Why Synchronize
Coordinated tasks in multi‑host environments (e.g., LNMP stacks) require consistent timestamps.
Incorrect timestamps can break HTTPS verification or log correlation.
Directly contacting public NTP servers from many hosts adds latency and bandwidth consumption; a local time server mitigates these issues.
How Synchronization Works
Traditional NTP adjusts the clock in large steps, which can cause gaps in file timestamps. Chrony, a modern NTP implementation, slews the clock gradually, achieving convergence within seconds or milliseconds.
Chrony Overview
Chrony implements the NTP protocol and can act as both server and client.
It consumes minimal CPU and can fall back to ntpdate compatibility.
It allows other hosts on the local network to obtain time from it.
Installing Chrony
yum install chrony -yKey files:
Configuration: /etc/chrony.conf Client binary: /usr/bin/chronyc Daemon:
/usr/sbin/chronydTypical chrony.conf Settings
# Remote NTP pool servers
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# Record drift
driftfile /var/lib/chrony/drift
# Fast step if offset > 1 s
makestep 1.0 3
# Enable RTC sync
rtcsync
# Allow local network
allow 192.168.0.0/16
# Serve even without external sync
local stratum 10
# Log settings
logdir /var/log/chrony
log measurements statistics trackingModify the file to point to internal NTP sources (e.g., server ntp1.aliyun.com iburst) and permit the desired subnet (e.g., allow 172.16.1.0/24).
Applying Changes
systemctl restart chronydClient Usage
Manual sync with ntpdate or chronyc -a makestep.
Automatic daemon sync via chronyd running in the background.
Verifying Synchronization
chronyc sourcesOutput shows the number of sources and their status, confirming that the local server (e.g., 172.16.1.62) is being used.
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.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
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.
