ntpstat works but not ntpq
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
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.
Please advise.
linux ntp
add a comment |Â
up vote
1
down vote
favorite
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.
Please advise.
linux ntp
my guest is that your host machine is serving NTP to your VM and you doesn't really need ntp.
â Kiwy
May 4 at 6:21
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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.
Please advise.
linux ntp
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.
Please advise.
linux ntp
asked May 3 at 12:52
Ilya Ulis
63
63
my guest is that your host machine is serving NTP to your VM and you doesn't really need ntp.
â Kiwy
May 4 at 6:21
add a comment |Â
my guest is that your host machine is serving NTP to your VM and you doesn't really need ntp.
â Kiwy
May 4 at 6:21
my guest is that your host machine is serving NTP to your VM and you doesn't really need ntp.
â Kiwy
May 4 at 6:21
my guest is that your host machine is serving NTP to your VM and you doesn't really need ntp.
â Kiwy
May 4 at 6:21
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
I have solved the issue.
For some strange reason it was lack of localhost lines in /etc/hosts at all.
So I have appended the lines bellow to /etc/hosts :
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Once I added such lines, the issue was solved.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
I have solved the issue.
For some strange reason it was lack of localhost lines in /etc/hosts at all.
So I have appended the lines bellow to /etc/hosts :
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Once I added such lines, the issue was solved.
add a comment |Â
up vote
0
down vote
accepted
I have solved the issue.
For some strange reason it was lack of localhost lines in /etc/hosts at all.
So I have appended the lines bellow to /etc/hosts :
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Once I added such lines, the issue was solved.
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I have solved the issue.
For some strange reason it was lack of localhost lines in /etc/hosts at all.
So I have appended the lines bellow to /etc/hosts :
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Once I added such lines, the issue was solved.
I have solved the issue.
For some strange reason it was lack of localhost lines in /etc/hosts at all.
So I have appended the lines bellow to /etc/hosts :
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Once I added such lines, the issue was solved.
edited May 6 at 8:05
answered May 3 at 16:10
Ilya Ulis
63
63
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441539%2fntpstat-works-but-not-ntpq%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
my guest is that your host machine is serving NTP to your VM and you doesn't really need ntp.
â Kiwy
May 4 at 6:21