openstack-manuals/doc/install-guide/section_basics-ntp.xml
Andreas Jaeger 8f2a7075e9 Fix stop-chunking
In some cases the stop-chunking directive contained an extra hyphen,
remove it so that the directive is effective.

Change-Id: I4972aea3e0c9ee8a85718b47ca5b93f1b68329b9
2014-07-25 22:17:21 +02:00

153 lines
7.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0"
xml:id="basics-ntp">
<?dbhtml stop-chunking?>
<title>Network Time Protocol (NTP)</title>
<para>You must install
<glossterm baseform="Network Time Protocol (NTP)">NTP</glossterm> to
properly synchronize services among nodes. We recommend that you configure
the controller node to reference upstream servers and other nodes to
reference the controller node.</para>
<section xml:id="basics-ntp-controller-node">
<title>Configure controller node</title>
<procedure>
<title>To install the NTP service</title>
<step>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install ntp</userinput></screen>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>yum install ntp</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install ntp</userinput></screen>
</step>
</procedure>
<procedure>
<title>To configure the NTP service</title>
<para>By default, the controller node synchronizes the time via a pool
of public servers. However, you can optionally edit the
<filename>/etc/ntp.conf</filename> file to configure alternative
servers such as those provided by your organization.</para>
<step>
<para>Edit the <filename>/etc/ntp.conf</filename> file:</para>
<para>Add, change, or remove the <literal>server</literal> keys as
necessary for your environment. Replace
<replaceable>NTP_SERVER</replaceable> with the hostname or IP address
of suitable NTP server.</para>
<programlisting>server <replaceable>NTP_SERVER</replaceable> iburst</programlisting>
<note os="ubuntu;debian">
<para>Remove the <filename>/var/lib/ntp/ntp.conf.dhcp</filename> file
if it exists.</para>
</note>
</step>
<step os="ubuntu;debian">
<para>Restart the NTP service:</para>
<screen><prompt>#</prompt> <userinput>service ntp restart</userinput></screen>
</step>
<step os="rhel;centos;fedora;sles;opensuse">
<para>Start the NTP service and configure it to start when the system
boots:</para>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>service ntpd start</userinput>
<prompt>#</prompt> <userinput>chkconfig ntpd on</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>service ntp start</userinput>
<prompt>#</prompt> <userinput>chkconfig ntp on</userinput></screen>
</step>
</procedure>
</section>
<section xml:id="basics-ntp-other-nodes">
<title>Configure other nodes</title>
<procedure>
<title>To install the NTP service</title>
<step>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install ntp</userinput></screen>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>yum install ntp</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install ntp</userinput></screen>
</step>
</procedure>
<procedure>
<title>To configure the NTP service</title>
<para>Configure the network and compute nodes to reference the
controller node.</para>
<step>
<para>Edit the <filename>/etc/ntp.conf</filename> file:</para>
<para>Comment out or remove all but one <literal>server</literal>
key and change it to reference the controller node.</para>
<programlisting>server <replaceable>controller</replaceable> iburst</programlisting>
<note os="ubuntu;debian">
<para>Remove the <filename>/var/lib/ntp/ntp.conf.dhcp</filename> file
if it exists.</para>
</note>
</step>
<step os="ubuntu;debian">
<para>Restart the NTP service:</para>
<screen><prompt>#</prompt> <userinput>service ntp restart</userinput></screen>
</step>
<step os="rhel;centos;fedora;sles;opensuse">
<para>Start the NTP service and configure it to start when the system
boots:</para>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>service ntpd start</userinput>
<prompt>#</prompt> <userinput>chkconfig ntpd on</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>service ntp start</userinput>
<prompt>#</prompt> <userinput>chkconfig ntp on</userinput></screen>
</step>
</procedure>
</section>
<section xml:id="basics-ntp-verify">
<title>Verify operation</title>
<para>We recommend that you verify NTP synchronization before proceeding
further. Some nodes, particularly those that reference the controller
node, can take several minutes to synchronize.</para>
<procedure>
<title>To verify NTP synchronization</title>
<step>
<para>Run this command on the <emphasis>controller</emphasis> node:
</para>
<screen><prompt>#</prompt> <userinput>ntpq -c peers</userinput>
<computeroutput> remote refid st t when poll reach delay offset jitter
==============================================================================
*ntp-server1 192.0.2.11 2 u 169 1024 377 1.901 -0.611 5.483
+ntp-server2 192.0.2.12 2 u 887 1024 377 0.922 -0.246 2.864</computeroutput></screen>
<para>Contents in the <emphasis>remote</emphasis> column should
indicate the hostname or IP address of one or more NTP servers.</para>
<note>
<para>Contents in the <emphasis>refid</emphasis> column typically
reference IP addresses of upstream servers.</para>
</note>
</step>
<step>
<para>Run this command on the <emphasis>controller</emphasis> node:
</para>
<screen><prompt>#</prompt> <userinput>ntpq -c assoc</userinput>
<computeroutput>ind assid status conf reach auth condition last_event cnt
===========================================================
1 20487 961a yes yes none sys.peer sys_peer 1
2 20488 941a yes yes none candidate sys_peer 1</computeroutput></screen>
<para>Contents in the <emphasis>condition</emphasis> column should
indicate <literal>sys.peer</literal> for at least one server.</para>
</step>
<step>
<para>Run this command on <emphasis>all other</emphasis> nodes:</para>
<screen><prompt>#</prompt> <userinput>ntpq -c peers</userinput>
<computeroutput> remote refid st t when poll reach delay offset jitter
==============================================================================
*controller 192.0.2.21 3 u 47 64 37 0.308 -0.251 0.079</computeroutput></screen>
<para>Contents in the <emphasis>remote</emphasis> column should
indicate the hostname of the controller node.</para>
<note>
<para>Contents in the <emphasis>refid</emphasis> column typically
reference IP addresses of upstream servers.</para>
</note>
</step>
<step>
<para>Run this command on <emphasis>all other</emphasis> nodes:
</para>
<screen><prompt>#</prompt> <userinput>ntpq -c assoc</userinput>
<computeroutput>ind assid status conf reach auth condition last_event cnt
===========================================================
1 21181 963a yes yes none sys.peer sys_peer 3</computeroutput></screen>
<para>Contents in the <emphasis>condition</emphasis> column should
indicate <literal>sys.peer</literal>.</para>
</step>
</procedure>
</section>
</section>