Configuring chrony

Solution Verified - Updated

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 chronyd work ?

Resolution

Here are few possible configurations for the chronyd service.

  1. If you have 4 NTP servers foo.example.net, bar.example.net, baz.example.net, and bat.example.net, your /etc/chrony.conf file could contain the following time sources directives:

                server foo.example.net
                server bar.example.net
                server baz.example.net
                server bat.example.net
    
  2. Some other useful directives : driftfile, makestep, rtcsync, and iburst. 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
    
  3. 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 pool directive instead of multiple server directives. 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:

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
    
SBR
Category

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.