NTP: Difference between revisions
No edit summary |
(Modified) |
||
| Line 1: | Line 1: | ||
You can use the following command to check if it's enabled:<br> | You can use the following command to check if it's enabled:<br> | ||
<pre>ntpdate -q</pre><pre>chkconfig --list | grep ntpd</pre> | <pre>ntpdate -q</pre><pre>chkconfig --list | grep ntpd</pre> | ||
If all the columns are 'off', then it's not enabled. | If all the columns are 'off', then it's not enabled. | ||
You can use the following command to enable NTP:<br> | You can use the following command to enable NTP:<br> | ||
| Line 8: | Line 8: | ||
Then use the following command to start it:<br> | Then use the following command to start it:<br> | ||
<pre>service ntpd start | <pre>service ntpd start | ||
</pre> | </pre> | ||
You can check if the time is in sync using:<br> | |||
You can check if the time is in sync using:<br> | |||
<pre>ntpq -p</pre> | <pre>ntpq -p</pre> | ||
It will display a list of servers and the server which is currently synced should be prepended by a '*'. For example: | It will display a list of servers and the server which is currently synced should be prepended by a '*'. For example: | ||
<pre> | <pre> remote refid st t when poll reach delay offset jitter | ||
============================================================================== | ============================================================================== | ||
*barricade.rack9 209.51.161.238 2 u 1001 1024 377 31.147 -0.369 20.074 | *barricade.rack9 209.51.161.238 2 u 1001 1024 377 31.147 -0.369 20.074 | ||
+ip-72-167-42-82 204.123.2.5 2 u 754 1024 377 166.388 -29.692 28.223 | +ip-72-167-42-82 204.123.2.5 2 u 754 1024 377 166.388 -29.692 28.223 | ||
+cheezum.mattnor 129.7.1.66 2 u 91 1024 377 45.715 1.504 47.753 | +cheezum.mattnor 129.7.1.66 2 u 91 1024 377 45.715 1.504 47.753 | ||
</pre> | </pre> | ||
In this case the host's time is synced with arricade.rack9. | In this case the host's time is synced with arricade.rack9. | ||
Revision as of 17:38, 1 December 2010
You can use the following command to check if it's enabled:
ntpdate -q
chkconfig --list | grep ntpd
If all the columns are 'off', then it's not enabled.
You can use the following command to enable NTP:
yum install ntpd chkconfig ntpd on
Then use the following command to start it:
service ntpd start
You can check if the time is in sync using:
ntpq -p
It will display a list of servers and the server which is currently synced should be prepended by a '*'. For example:
remote refid st t when poll reach delay offset jitter ============================================================================== *barricade.rack9 209.51.161.238 2 u 1001 1024 377 31.147 -0.369 20.074 +ip-72-167-42-82 204.123.2.5 2 u 754 1024 377 166.388 -29.692 28.223 +cheezum.mattnor 129.7.1.66 2 u 91 1024 377 45.715 1.504 47.753
In this case the host's time is synced with arricade.rack9.