0

I have one server running CentOS 7

to install ntp module I followed the below steps:

yum install -y ntp
systemctl start ntpd
systemctl enable ntpd
systemctl status ntpd
timedatectl set-timezone America/Mexico_City

the service is running, I did not get any error,

 systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-04-07 12:43:43 CDT; 50min left
  Process: 2652 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 2653 (ntpd)
   CGroup: /system.slice/ntpd.service
           └─2653 /usr/sbin/ntpd -u ntp:ntp -g

Apr 07 12:43:43 i7box ntpd[2653]: Listen normally on 6 enp3s0 fe80::1cfd:83c7:5a71:977c UDP 123
Apr 07 12:43:43 i7box ntpd[2653]: Listen normally on 7 lo ::1 UDP 123
Apr 07 12:43:43 i7box ntpd[2653]: Listening on routing socket on fd #24 for interface updates
Apr 07 12:43:43 i7box systemd[1]: Started Network Time Service

but when I type timedatectl

 timedatectl
      Local time: Sat 2018-04-07 12:43:45 CDT
  Universal time: Sat 2018-04-07 17:43:45 UTC
        RTC time: Sat 2018-04-07 17:43:45
       Time zone: America/Mexico_City (CDT, -0500)
     NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2018-04-01 01:59:59 CST
                  Sun 2018-04-01 03:00:00 CDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2018-10-28 01:59:59 CDT
                  Sun 2018-10-28 01:00:00 CST

the NTP appears as NTP enabled: no, I already opened the port 123/udp

is there a missing step?

Frederick Álvarez
  • 153
  • 1
  • 2
  • 7
  • It is a bit misleading, it does not mean you have no NTP, it means you have no timesyncd, see the man page. – eckes Apr 07 '18 at 17:42

1 Answers1

0

If that really was the problem, the missing step to make NTP enabled: yes is:

timedatectl set-ntp true

However, your ntpd might well be working fine even without:

You can see more detailed information using ntpd -q. It'll list the servers used for synchronization and their status. These servers are configured in /etc/ntp.conf and you may change the default

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

with pool servers that are near you. Currently mx.pool.ntp.org doesn't have enough servers (you may join the pool):

There are not enough servers in this zone, so we recommend you use the North America zone (north-america.pool.ntp.org):

server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
server 3.north-america.pool.ntp.org
Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129