Synchronising Linux host to NTP Server

1

1

I'm trying to synchronize the time of Linux host with NTP server. The configuration file is modified with server information and the NTP service is started using the command

service ntpd start

By executing the following command i have checked whether the NTP server is added or not

ntpq -pn

The name of the ntp server is been listed in the output.

But there is no change in time. Help me to synchronize the time with NTP server permanently (without ntpdate command as time is changed when reboot occurs)

Thanks in advance

Shabz

Posted 2016-07-27T07:56:12.207

Reputation: 11

Usually ntpdate has to be used before syncing and run at boot time – mabagu – 2016-07-28T05:36:21.560

I have tried the same by executing ntpdate command and then ntpd. The clock changes but the synchronisation symbol * is not displayed for the ntp server when i execute ntpq -pn command – Shabz – 2016-07-28T05:42:58.333

could you post the output from ntpq -pcrv please in your question which you can edit with the link underneath. – user3788685 – 2016-08-02T20:31:20.517

Answers

1

For several reasons, ntpd does not like to correct large time discrepancies in a single swoop. What it does instead is to slew the clock gently, but this in turn means that it will catch up very slowly.

In fact, the Manual states:

-x

Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete....

My suggestion is that you synchronize the clock manually with date, as follows,

date -s "7/27/2016 07:07:00"

and then check whether ntpd is able to bring, slowly, the discrepancy down to just about zero.

MariusMatutiae

Posted 2016-07-27T07:56:12.207

Reputation: 41 321

Other than that i have used ntpdate command and then i have started the ntpd service.. – Shabz – 2016-07-28T05:37:01.507

But stil the symbol * is not shown on the server when i execute ntpq -pn command – Shabz – 2016-07-28T05:38:54.953