Linux Administrator

How to: Setup Chrony NTP Server in CentOS / RHEL 7

In this tutorial we will learn how to setup Chrony NTP server in CentOS/RHEL 7 servers. Chrony is same as NTP server. Chrony is designed for those system that are often powered down or disconnect from the network. /etc/chrony.conf file is the main configuration file for Chrony. This file is similar to the /etc/ntp.conf file and chronyd is the daemon that runs in user space. It is a command line program that provides a command prompt that provides system time information and current sources.

Setup Chrony NTP Server

Setup NTP Server Using Chrony on CentOS/RHEL 7

Install Chrony

Follow the below command to install chrony package on CentOS/RHEL 7 systems.

# yum install chrony

Use the below command to start chrony in startup or boot time:

# systemctl start chronyd
# systemctl enable chronyd

Configure Chrony

This is the simple configuration file:

# grep -v '^#' /etc/chrony.conf

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
driftfile /var/lib/chrony/drift
makestep 1.0 3
logdir /var/log/chrony

Simple configuration directives information:

  • server :  This directive is used to describe NTP servers which you want to sync from.
  • driftfile: This is used for location and name of the file containing drift data.
  • makestep: This directive causes chrony to gradually correct any time offset by speeding or slowing down the clock as required.
  • logdir: This is the path to save all chrony’s logs.

Use below command to setup system clock at run time.

# chronyc makestep

Use follow command to stop chrony.

For SytemD

# systemctl stop chrony

For Init

# /etc/init.d/chronyd stop

FAQs:

What is Network Time Protocol (NTP)?

Network Time Protocol is used to synchronize computer system clock automatically over the network. It is a protocol.

What is the location of chrony configuration file?

You can find the chrony configuration file at /etc/chrony.conf or /etc/chrony.d/*.

How NTP server works?

Network Time Protocol uses coordinated Universal Time (UTC) to synchronize computer clock times with extreme precision. It provides the great accuracy on smaller networks. 10 milliseconds over the internet and 1 milliseconds in a LAN (Local Area Network).

What is NTP port?

NTP use 123 port and it works within the TCP/IP suite and relay on UDP (User Datagram Protocol).

How can I find my NTP server IP address?

To find NTP server IP type ” Net Time/querysntp” in the command prompt and press “Enter”  key. In the output you will get the NTP server settings.

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment