Setting up Time Server

Chrony is the now the default network time protocol for RHEL/Centos 7. Chrony is an alternative NTP client and server that is designed specifically for systems that are not online all the time.

  • Install Chrony

    yum -y install chrony

  • Edit /etc/chrony.conf . Specifically, add the “allow network” line so your clients can connect to this server locally.

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

stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3

# Allow NTP client access from local network.
allow 192.168.88.0/24

# Listen for commands only on localhost.
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
noclientlog
logchange 0.5
logdir /var/log/chrony
  • On the clients, edit /etc/chrony.conf
# specify chrony server
server ntp.gracie.net

driftfile /var/lib/chrony/drift
logdir /var/log/chrony
log measurements statistics tracking
keyfile /etc/chrony.keys
commandkey 24
initstepslew 20 master
  • Start chronyd

    systemctl start chronyd

  • Enable chronyd on boot

    systemctl enable chronyd

Using Chrony

  • Checking chrony tracking

    chronyc tracking

  • Checking chrony sources

    chronyc sources

  • Checking chrony source statistics

    chronyc sourcestats

Written on November 19, 2015