Skip to content

Instantly share code, notes, and snippets.

@leosaa
Last active April 20, 2020 23:44
Show Gist options
  • Save leosaa/64533d1fe6be74bcfee0966234e2600e to your computer and use it in GitHub Desktop.
Save leosaa/64533d1fe6be74bcfee0966234e2600e to your computer and use it in GitHub Desktop.
Setting chronic in Red Hat/Centos 8

Setting chrony in Red Hat/Centos 8

Red Hat has moved the Network Time Protocol implementation from ntp package to chrony(*)

Set your timezone

The system’s timezone is set during the install process, but it can be easily changed at a later time.

timedatectl is the command to set time and date. An example on how to set and check the timezone for Mount Time Zone or America/Denver (MDT)

timedatectl list-timezones | grep Denver
America/Denver

timedatectl set-timezone America/Denver
    date
    Wed Apr  1 21:59:23 MDT 2020

Install chrony

Chrony is available from the official repositories

dnf install chrony

Edit the configuration file:

vim /etc/chrony.conf

and add the following lines the with the ntp servers, for example:

pool time.facebook.com iburst
pool time.google.com iburst
pool time.apple.com iburst

enable chronyc daemon:

systemctl enable --now  chronyd
systemctl status chronyd

Check chrony

chronyc sources
210 Number of sources = 10
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^- time3.facebook.com            1   7   377   296    -32ms[  -32ms] +/-  143ms
^? time1.facebook.com            0   6     0     -     +0ns[   +0ns] +/-    0ns
^* time4.google.com              1  10   377   966  +3724us[+4473us] +/-   36ms
^+ time3.google.com              1  10   377   122    +21ms[  +21ms] +/-   53ms
^+ time2.google.com              1  10   377   897  -2047us[-2047us] +/-   31ms
^+ time1.google.com              1  10   377   333    -15ms[  -15ms] +/-   49ms
^- usscz2-ntp-002.aaplimg.c>     1  10   317  1023  -8067us[-7321us] +/-   97ms
^- ussjc2-ntp-001.aaplimg.c>     1   8   377   169    -27ms[  -27ms] +/-  269ms
^- uslax1-ntp-002.aaplimg.c>     1   9   337   303  +2965us[+2965us] +/-   44ms
^- uslax1-ntp-001.aaplimg.c>     1   9   217   300   +460us[ +460us] +/-   32ms
chronyc sourcestats
210 Number of sources = 10
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
time3.facebook.com         19  11   26m     +1.513     55.555  -9021us    19ms
time1.facebook.com          0   0     0     +0.000   2000.000     +0ns  4000ms
time4.google.com           32  15   87m     -0.118      1.161   -538us  2143us
time3.google.com           32  16  101m     +1.012      2.371  +5747us  3057us
time2.google.com           31  17   88m     -0.443      1.110  -2334us  2292us
time1.google.com           31  15   97m     +0.557      1.928  -1115us  2708us
17.253.16.253              28  13  100m    +14.229     15.377    +72ms    29ms
ussjc2-ntp-001.aaplimg.c>  12   5   62m    +16.399     32.402  -2280us    25ms
uslax1-ntp-002.aaplimg.c>  22  11   47m     +8.945     31.209  +6443us    32ms
uslax1-ntp-001.aaplimg.c>  26  14   63m     +7.318     21.143   +497us    29ms
[root@centos8-01 ~]# chronyc tracking
Reference ID    : D8EF230C (time4.google.com)
Stratum         : 2
Ref time (UTC)  : Thu Apr 02 04:25:47 2020
System time     : 0.000462417 seconds fast of NTP time
Last offset     : +0.000749799 seconds
RMS offset      : 0.002851715 seconds
Frequency       : 509.233 ppm slow
Residual freq   : +0.016 ppm
Skew            : 0.828 ppm
Root delay      : 0.058634870 seconds
Root dispersion : 0.004686652 seconds
Update interval : 1038.9 seconds
Leap status     : Normal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment