NTP

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(fix ntp procedure)
m
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Installing NTP<br> ==
 
<pre>yum install ntpd
 
</pre>
 
== Configuring NTP ==
 
  
=== Setting the time zone<br> ===
+
'''Starting from version 2.9, the timezone can be configured from the web portal in the services section:'''
 +
[[Toolpack:System_Settings_B#Services|Set NTP servers in Date/Time Services]]
  
Make sure that the host time zone is set properly. To modify the time zone go [http://kezhong.wordpress.com/2010/03/08/change-timezone-on-centos-5-4/ here]<br>
 
  
=== Setting the DNS&nbsp;server<br> ===
+
= System Configuration =
  
Make sure your nameserver (DNS) is configured correctly (see [[TBLinux:How_to_change_the_ip_address|Modify the dhcp client configuration]]).<br>
+
== Network Time Protocol (NTP) configuration <br>  ==
 +
On new units, NTP comes pre-installed and activated by default. <br>  
 +
You can use the '''tbntpconfig''' tool to choose the NTP servers to synchronize the time base of the system.
 +
<pre>
 +
[root@TB000001 ~]# tbntpconfig
  
=== Modify NTP Server List<br> ===
+
###############################################################
 +
# Current NTP servers:
 +
#
 +
NTP server1 = '0.centos.pool.ntp.org'
 +
NTP server2 = '1.centos.pool.ntp.org'
 +
NTP server3 = '2.centos.pool.ntp.org'
  
Modify your ntp server list
+
Do you want to modify the current NTP servers list (enter 'help' for usage) ?[No] Yes
<pre>vim /etc/ntp.conf</pre>
+
</pre>
Change the server list for those closer to your server. List can be found [http://www.pool.ntp.org/en/ here]<br>Example for Canadian servers: <br>
+
You can also use the manual method as described below.
 +
 
 +
= Manual configuration <br>  =
 +
== Installing NTP<br>  ==
 +
<pre>yum install ntp
 +
</pre>
 +
== Configuring NTP  ==
 +
 
 +
=== Setting the time zone<br>  ===
 +
 
 +
Make sure that the host time zone is set properly. To modify the time zone go [http://kezhong.wordpress.com/2010/03/08/change-timezone-on-centos-5-4/ here]<br>
 +
 
 +
=== Setting the DNS&nbsp;server<br>  ===
 +
 
 +
Make sure your nameserver (DNS) is configured correctly (see [[TBLinux:How to change the ip address|Modify the dhcp client configuration]]).<br>
 +
 
 +
=== Modify NTP Server List (Optional)<br>  ===
 +
 
 +
Modify your ntp server list  
 +
<pre>vim /etc/ntp.conf</pre>  
 +
Change the server list for those closer to your server. List can be found [http://www.pool.ntp.org/en/ here]<br>Example for Canadian servers: <br>  
 
<pre>server 0.ca.pool.ntp.org
 
<pre>server 0.ca.pool.ntp.org
 
server 1.ca.pool.ntp.org
 
server 1.ca.pool.ntp.org
Line 22: Line 47:
 
server 3.ca.pool.ntp.org
 
server 3.ca.pool.ntp.org
  
</pre>
+
</pre>  
=== Synchronize the host date with the NTP&nbsp;server<br> ===
+
=== Synchronize the host date with the NTP&nbsp;server<br> ===
  
'''Warning''': This may result is a jump in time of several minutes.<br>
+
'''Warning''': This may result is a jump in time of several minutes.<br>  
  
Use ntpdate to synchronize your server time with a NTP server.<br>
+
Use ntpdate to synchronize your server time with a NTP server.<br>  
  
Example showing a host synchronization with a Canadian server.<br>
+
Example showing a host synchronization with a Canadian server.<br>  
 
<pre>ntpdate 0.ca.pool.ntp.org
 
<pre>ntpdate 0.ca.pool.ntp.org
</pre>
+
</pre>  
=== Start NTP<br> ===
+
== Start NTP<br> ==
  
 
You can use the following command to enable NTP:<br>  
 
You can use the following command to enable NTP:<br>  
 
<pre>chkconfig ntpd on
 
<pre>chkconfig ntpd on
service ntpd start
+
service ntpd start  
+
 
</pre>  
 
</pre>  
== Verify NTP server status<br> ==
+
== Verify NTP server status<br> ==
  
To synchronize NTP:  
+
To verify the synchronization between the host and the NTP servers:  
 
<pre>ntpq -p</pre>  
 
<pre>ntpq -p</pre>  
<br>Example of host synched with barricade.rack9: <br>
+
'''Note''': After starting the NTP service, the system requires at least 10 minutes to accept a reference server.
 +
 
 +
<br>Example of host synched with barricade.rack9: <br>  
 
<pre>    remote          refid      st t when poll reach  delay  offset  jitter
 
<pre>    remote          refid      st t when poll reach  delay  offset  jitter
 
==============================================================================
 
==============================================================================

Latest revision as of 16:00, 12 November 2018

Starting from version 2.9, the timezone can be configured from the web portal in the services section: Set NTP servers in Date/Time Services


Contents

System Configuration

Network Time Protocol (NTP) configuration

On new units, NTP comes pre-installed and activated by default.
You can use the tbntpconfig tool to choose the NTP servers to synchronize the time base of the system.

 
[root@TB000001 ~]# tbntpconfig

###############################################################
# Current NTP servers:
#
 NTP server1 = '0.centos.pool.ntp.org'
 NTP server2 = '1.centos.pool.ntp.org'
 NTP server3 = '2.centos.pool.ntp.org'

Do you want to modify the current NTP servers list (enter 'help' for usage) ?[No] Yes

You can also use the manual method as described below.

Manual configuration

Installing NTP

yum install ntp

Configuring NTP

Setting the time zone

Make sure that the host time zone is set properly. To modify the time zone go here

Setting the DNS server

Make sure your nameserver (DNS) is configured correctly (see Modify the dhcp client configuration).

Modify NTP Server List (Optional)

Modify your ntp server list

vim /etc/ntp.conf

Change the server list for those closer to your server. List can be found here
Example for Canadian servers:

server 0.ca.pool.ntp.org
server 1.ca.pool.ntp.org
server 2.ca.pool.ntp.org
server 3.ca.pool.ntp.org

Synchronize the host date with the NTP server

Warning: This may result is a jump in time of several minutes.

Use ntpdate to synchronize your server time with a NTP server.

Example showing a host synchronization with a Canadian server.

ntpdate 0.ca.pool.ntp.org

Start NTP

You can use the following command to enable NTP:

chkconfig ntpd on
service ntpd start 

Verify NTP server status

To verify the synchronization between the host and the NTP servers:

ntpq -p

Note: After starting the NTP service, the system requires at least 10 minutes to accept a reference server.


Example of host synched with barricade.rack9:

     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

The '*' represent the current reference server
The '+' represent a potential backup reference server
The '-' represent a rejected reference server

Personal tools