Network Time (ntp): Difference between revisions

From JCWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Our ntp servers are:
  Castle 69.55.230.2
  I2B    69.55.229.2
# see if its connected:
# see if its connected:


Line 15: Line 23:
<ol start="3">
<ol start="3">
<li>Query the NTP Server to see if it is paired</li>
<li>Query the NTP Server to see if it is paired</li>
[root@quar1 /vz/private]# ntpq -pn
[root@quar1 /vz/private]#''' ntpq -pn'''
     remote          refid      st t when poll reach  delay  offset jitter<br>10.1.4.5        66.187.233.4    2 u    4  64    1    0.317  876558.  0.000
     remote          refid      st t when poll reach  delay  offset jitter<br>10.1.4.5        66.187.233.4    2 u    4  64    1    0.317  876558.  0.000
<br>
<br>
</ol>
<ol start="4">
<ol start="4">
<li>[root@quar1 /vz/private]# date</li>
<li>[root@quar1 /vz/private]#''' date'''</li>
Thu Oct 11 10:58:05 PDT 2012
Thu Oct 11 10:58:05 PDT 2012
</ol>
</ol>
:<big>time is 11:13</big>
:<big>time is 11:13</big>
<span style="color:red">that output from ntpq is deceiving- we're syncing connected. you want to see a * or + next to it (ex on mail):</span>
<ol start="5">
<li>mail /usr/local/www/scripts#''' ntpq -pn'''</li>
</ol>
    remote          refid      st t when poll reach  delay  offset jitter
    ==============================================================================
    *66.187.233.4    .CDMA.          1 u  550 1024  377  75.159  -0.613 0.100
      217.204.76.170  0.0.0.0        16 u    - 1024    0    0.000    0.000 4000.00
      64.112.189.11  0.0.0.0        16 u    - 1024    0    0.000    0.000 4000.00
      66.69.112.130  0.0.0.0        16 u    - 1024    0    0.000    0.000 4000.00
    +80.85.129.25    193.79.237.14    2 u  624 1024  377  147.067  -0.291 0.149
<span style="color:red">(btw, if at least one is not + or * our ENTIRE network is off since all boxes sync to mail.
edit /etc/ntp.conf to add servers)</span>
see: http://doc.ntp.org/4.1.1/ntpq.htm
so its not connecting to our ntpd on mail (10.1.4.5)
and this is likely cause of the large time gap (offset 876558.) so we fix it:
<ol start="6">
<li>[root@quar1 /vz/private]# '''date -s "11:17:00"'''<br>
Thu Oct 11 11:17:00 PDT 2012</li>
</ol>
<ol start="7">
<li>[root@quar1 /vz/private]#''' ntpq -pn'''</li>
</ol>
    remote          refid      st t when poll reach  delay  offset jitter
    ==============================================================================
      10.1.4.5        66.187.233.4    2 u 1029  64    0    0.000    0.000 4000.00
no offset but not connected. give it some time...
<ol start="8">
<li>[root@quar1 /vz/private]#''' sleep 300; ntpq -pn'''</li>
</ol>
    remote          refid      st t when poll reach  delay  offset jitter
    ==============================================================================
    *10.1.4.5        66.187.233.4    2 u  44  64  37    0.304  19234.8 0.649
<span style="color:red"><big>Yay, done.</big></span>

Latest revision as of 15:36, 5 August 2015


Our ntp servers are:

 Castle 69.55.230.2
 I2B    69.55.229.2


  1. see if its connected:
[root@quar1 /vz/private]# ntpq -pn
ntpq: read: Connection refused
not running
  1. start it:
  2. [root@quar1 /vz/private]# service ntpd start
    Starting ntpd: [ OK ]
  1. Query the NTP Server to see if it is paired
  2. [root@quar1 /vz/private]# ntpq -pn remote refid st t when poll reach delay offset jitter
    10.1.4.5 66.187.233.4 2 u 4 64 1 0.317 876558. 0.000
  1. [root@quar1 /vz/private]# date
  2. Thu Oct 11 10:58:05 PDT 2012
time is 11:13

that output from ntpq is deceiving- we're syncing connected. you want to see a * or + next to it (ex on mail):


  1. mail /usr/local/www/scripts# ntpq -pn
    remote           refid      st t when poll reach   delay   offset jitter
    ==============================================================================
    *66.187.233.4    .CDMA.           1 u  550 1024  377   75.159   -0.613 0.100
     217.204.76.170  0.0.0.0         16 u    - 1024    0    0.000    0.000 4000.00
     64.112.189.11   0.0.0.0         16 u    - 1024    0    0.000    0.000 4000.00
     66.69.112.130   0.0.0.0         16 u    - 1024    0    0.000    0.000 4000.00
    +80.85.129.25    193.79.237.14    2 u  624 1024  377  147.067   -0.291 0.149

(btw, if at least one is not + or * our ENTIRE network is off since all boxes sync to mail. edit /etc/ntp.conf to add servers)

see: http://doc.ntp.org/4.1.1/ntpq.htm

so its not connecting to our ntpd on mail (10.1.4.5)

and this is likely cause of the large time gap (offset 876558.) so we fix it:

  1. [root@quar1 /vz/private]# date -s "11:17:00"
    Thu Oct 11 11:17:00 PDT 2012
  1. [root@quar1 /vz/private]# ntpq -pn
    remote           refid      st t when poll reach   delay   offset jitter
    ==============================================================================
     10.1.4.5        66.187.233.4     2 u 1029   64    0    0.000    0.000 4000.00

no offset but not connected. give it some time...

  1. [root@quar1 /vz/private]# sleep 300; ntpq -pn
    remote           refid      st t when poll reach   delay   offset jitter
    ==============================================================================
    *10.1.4.5        66.187.233.4     2 u   44   64   37    0.304  19234.8 0.649

Yay, done.