CentOS 7 1511 and ntpd - rharmonson/richtech GitHub Wiki

#CentOS 7 1511 and ntpd

CentOS has moved from using ntpd to chrony for network time. Below are instruction for removal of chrony an installing ntpd.

##Remove chrony

[root@myhost ~]# systemctl stop chronyd
[root@myhost ~]# systemctl disable chronyd
[root@myhost ~]# yum remove chronyd

###Install ntpd

[root@myhost ~]# yum install ntp

Results with

================================================================================
 Package              Arch        Version                       Repository
                                                                           Size
================================================================================
Installing:
 ntp                  x86_64      4.2.6p5-22.el7.centos         base      543 k
Installing for dependencies:
 autogen-libopts      x86_64      5.18-5.el7                    base       66 k
 ntpdate              x86_64      4.2.6p5-22.el7.centos         base       84 k

Transaction Summary
================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 693 k
Installed size: 1.6 M
Is this ok [y/d/N]: 

Configure NTP

You can either accept the exising NTP servers or update them to your preference. Generally, I use my own time source.

[root@myhost ~]# vi /etc/ntp.conf

Comment out the existing lines with "server" then add one line for your preferred time source(s). For the example below, I have commented out CentOS NTP hosts and using the United Stated pool from ntp.org.

server 0.us.pool.ntp.org iburst
server 1.us.pool.ntp.org iburst
server 2.us.pool.ntp.org iburst
server 3.us.pool.ntp.org iburst

Enable NTP

[root@myhost ~]# systemctl enable ntpd
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.

Start NTP

[root@myhost ~]# systemctl start ntpd

Test NTP

[root@myhost ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+repos.lax-noc.c 206.117.25.20    2 u    1   64    3   35.075   -1.010   0.736
-leeloo.scurvyne 173.162.192.156  2 u   58   64    1  128.067    9.418   1.970
*ntp.newfxlabs.c 128.9.176.30     2 u    3   64    3   33.694   -0.570   0.562
+104.131.53.252  209.51.161.238   2 u    1   64    3  121.707   -5.403   2.224