Network Time (ntp): Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
<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> | ||
<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> |
Revision as of 19:22, 18 November 2012
- see if its connected:
- [root@quar1 /vz/private]# ntpq -pn
- ntpq: read: Connection refused
- not running
- start it: [root@quar1 /vz/private]# service ntpd start
Starting ntpd: [ OK ]
- Query the NTP Server to see if it is paired [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
- [root@quar1 /vz/private]# date 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):
- 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:
- [root@quar1 /vz/private]# date -s "11:17:00"
Thu Oct 11 11:17:00 PDT 2012
- [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...
- [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.