I'm trying to configure NTP client on RHEL7.4 I'm running the "ntpstat" command and seeing that I have synchronized:
[root@my-machine ~]# ntpstat
synchronised to NTP server (ntp-server ip) at stratum 5
time correct to within 1173 ms
polling server every 64 s
but when I'm running the "ntpq -p" command, I'm getting an error:
[root@my-machine ~]# ntpq -p
localhost.ntp-server.com: timed out, nothing received
***Request timed out
For some reason NTP has appended a prefix of "localhost" to ntp-server hostname.
Here is my /etc/ntp.conf:
[root@my-machine ~]# egrep -v '^#|^[[:blank:]]*$' /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
server ntp-server.com prefer iburst
I should make the "ntpq" command working as this machine part of Cloudera cluster and cloudera-agent using the "ntpq -np" to be sure that NTP is synchronized.