ntpstat works but not ntpq

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question



















  • 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














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.







share|improve this question



















  • 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












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.







share|improve this question











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.









share|improve this question










share|improve this question




share|improve this question









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
















  • 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










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.






share|improve this answer























    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    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






























    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.






    share|improve this answer



























      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.






      share|improve this answer

























        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.






        share|improve this answer















        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.







        share|improve this answer















        share|improve this answer



        share|improve this answer








        edited May 6 at 8:05


























        answered May 3 at 16:10









        Ilya Ulis

        63




        63






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay