Configuring chrony
Environment
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 7
Issue
- Sample configuration for
chronyd. - What are important configuration parameters required to make
chronydwork ?
Resolution
Here are few possible configurations for the chronyd service.
-
If you have 4 NTP servers
foo.example.net,bar.example.net,baz.example.net, andbat.example.net, your/etc/chrony.conffile could contain the following time sources directives:server foo.example.net server bar.example.net server baz.example.net server bat.example.net -
Some other useful directives :
driftfile,makestep,rtcsync, andiburst. The smallest useful configuration file would look something like:server foo.example.net iburst server bar.example.net iburst server baz.example.net iburst server bat.example.net iburst driftfile /var/lib/chrony/drift makestep 10 3 rtcsync -
If using a pool of NTP servers (one name is used for multiple servers which may change over time), it's better to specify them with the
pooldirective instead of multipleserverdirectives. The configuration file could in this case look like:pool pool.ntp.org iburst driftfile /var/lib/chrony/drift makestep 10 3 rtcsync
To learn more about each of these parameters please refer to the documentation:
- RHEL7: Configuring NTP Using the chrony Suite
- RHEL8: Using the Chrony suite to configure NTP
- RHEL9: Using Chrony
Note : Ensure 123/UDP port is enabled bi-directionally in the firewall.
Root Cause
The default /etc/chrony.conf file can not be used as it is. It must be altered accordingly to include new NTP servers and other directives as needed.
Diagnostic Steps
-
Test configuration:
# timedatectl -
Display system time information
# chronyc tracking
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.