Chrony is an implementation of the Network Time Protocol. It is used to synchronize the system clock from different NTP servers, reference clocks, or via manual input. It runs on Unix-like operating systems and is released under the GNU GPL v2.
To Install Chrony use the following command:
yum install chrony -y
Let's sync the time of our centOS server with the remote NTP server manually. You can get a list of NTP Servers from ntppool.org -- It is recommended to select an NTP server located closest to your server location.
chronyd -q 'server 0.europe.pool.ntp.org iburst'
For North America,
chronyd -q 'server 0.north-america.pool.ntp.org iburst'
Start the chronyd service and setup chronyd to automatically start on reboots using the following commands,
systemctl start chronyd systemctl enable chronyd
Check that your system’s time is synchronized using chrony now.
From the above output,
- Reference ID is the ID/name of the server with which your system’s time is currently synced.
- Stratum is used here to indicate the number of hops away from the reference clock we are, or simply, the number of hops between us and the remote server we are connected to
List time sources used by chronyd.
List drift speed and offset estimation of each source that is used by chronyd.
chronyc sourcestats -v
You have now successfully synced your CentOS Stream 9 times with Chrony.