openstack-manuals/doc/install-guide/section_basics-ntp.xml
Christian Berendt 080e26fa61 Use ntp.service instead of ntpd.service to start NTP services on openSUSE
systemctl enable ntpd.service is not working on openSUSE 13.1:

---snip---
% sudo systemctl enable ntpd.service
Failed to issue method call: No such file or directory
---snap---

systemctl enable ntp.service is working on openSUSE 13.1:

---snip---
% sudo systemctl enable ntp.service
ntp.service is not a native service, redirecting to /sbin/chkconfig.
[...]
---snap---

Change-Id: I1979f08786bc1ea67c011415368bf57b35e11dd7
2014-10-10 12:19:42 +02:00

169 lines
8.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 more accurate (lower stratum) servers and
other nodes to reference the controller node.</para>
<section xml:id="basics-ntp-controller-node">
<title>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 and add,
change, or remove the following keys as necessary for your
environment:</para>
<programlisting language="ini">server <replaceable>NTP_SERVER</replaceable> iburst
restrict -4 default kod notrap nomodify
restrict -6 default kod notrap nomodify</programlisting>
<para>Replace <replaceable>NTP_SERVER</replaceable> with the
hostname or IP address of a suitable more accurate (lower stratum)
NTP server. The configuration supports multiple
<literal>server</literal> keys.</para>
<note>
<para>For the <literal>restrict</literal> keys, you essentially
remove the <literal>nopeer</literal> and <literal>noquery</literal>
options.</para>
</note>
<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;centos;fedora"><prompt>#</prompt> <userinput>systemctl enable ntpd.service</userinput>
<prompt>#</prompt> <userinput>systemctl start ntpd.service</userinput></screen>
<para os="sles">On SLES:</para>
<screen os="sles"><prompt>#</prompt> <userinput>service ntp start</userinput>
<prompt>#</prompt> <userinput>chkconfig ntp on</userinput></screen>
<para os="opensuse">On openSUSE:</para>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl enable ntp.service</userinput>
<prompt>#</prompt> <userinput>systemctl start ntp.service</userinput></screen>
</step>
</procedure>
</section>
<section xml:id="basics-ntp-other-nodes">
<title>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 language="ini">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>systemctl enable ntpd.service</userinput>
<prompt>#</prompt> <userinput>systemctl start ntpd.service</userinput></screen>
<para os="sles">On SLES:</para>
<screen os="sles"><prompt>#</prompt> <userinput>service ntp start</userinput>
<prompt>#</prompt> <userinput>chkconfig ntp on</userinput></screen>
<para os="opensuse">On openSUSE:</para>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl enable ntp.service</userinput>
<prompt>#</prompt> <userinput>systemctl start ntp.service</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>
<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>