How to set up the NTP service - [RHEL7/CENTOS7]

 How to set up the NTP service - [RHEL7/CENTOS7]

NTP is the protocol which synchronizes Data nad time using NTP server. To synchronizing date through NTP server required services are NTP and chrony.


By default NTP is the classic package, already existing in RHEL 6, RHEL 5 and chrony is the default package in RHEL 7.


We can also synchronize using below command.

# timedatectl set-timezone Asia/Kolkata


In this lession we will discuss how to configure chrony.

Install the Chrony service:

# yum install -y chrony


Activate the Chrony service at boot:

# systemctl enable chronyd


Start the Chrony service:

# systemctl start chronyd


Configure chrony:

# vi /etc/chrony.conf

Comment below lins:

server 0.rhel.pool.ntp.org iburst

server 1.rhel.pool.ntp.org iburst

server 2.rhel.pool.ntp.org iburst

server 3.rhel.pool.ntp.org iburst


Add your NTP server as below:

server xxx.xxx.xxx.xxx iburst

server xxx.xxx.xxx.xxx iburst


Restart the chrony service:

# systemctl stop chronyd

# systemctl start chronyd


Check if chrony service working:

# chronyc sources

210 Number of sources = 1

MS Name/IP address    Stratum    Poll   Reach   LastRx   Last sample 

=============================================================================

^* xxx.xxx.xxx.xxx           11        6      377      63      +1827us[+6783us]...

Comments

Popular posts from this blog

[SOLVED] YUM: can not find RHNS CA file ERROR: can not find RHNS CA file: /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT

Setting an Operating System Release During Registration

YUM Update ERROR: 28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds' Trying other mirror