Sie sind auf Seite 1von 6

Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

Solaris Cluster How to Configure/Use/Setup a NTP Server (Doc ID 1006115.1)

In this Document

Goal
Solution
  A) If you installed/configured your own /etc/inet/ntp.conf file then this configuration file will be used.
  B) If using the setup from Oracle Solaris Cluster  (SC):
  IMPORTANT if NTP will not start after installation of patch 145333-20 or 145334-20:
  IMPORTANT  if using Oracle Clusterware 11g on Solaris with or without Solaris Cluster:
  Information about 'leap second' handling in Solaris Cluster
References

APPLIES TO:

Solaris Cluster Geographic Edition - Version 3.1x to 4.4 [Release 3.1 to 4.4]
Solaris Cluster - Version 3.0 to 4.4 [Release 3.0 to 4.4]
Oracle Solaris on x86-64 (64-bit)
Oracle Solaris on SPARC (32-bit)
Oracle Solaris on SPARC (64-bit)

GOAL

This document describe details for using a Network Time Protocol (NTP) server in Solaris Cluster environment.

When using NTP, do not attempt to adjust the cluster time while the cluster is up and running. Do not adjust the time by
using the date(1), rdate(1M), xntpd(1M), or svcadm(1M) commands interactively or within cron(1M) scripts.

Bear in mind about above mentioned commands. If there is a time "leap" when Solaris Cluster is running then the cluster
node may panic.

To adjust the time in Solaris Cluster (independent if NTP is already running or not) follow the procedure in
Oracle Solaris Cluster System Administration Guide - How to Reset the Time of Day in a Cluster
The rough supported approach is:
* stop the cluster
* adjust the time on the cluster nodes in non-cluster-mode
* start the cluster

The NTP services have undergone some changes that lead to further changes on the Solaris Cluster software. The Solaris 11
NTP service does make use of NTP version4 (v4) only while in Solaris 10 the NTP v4 have been added as alternative to NTP
version3. In the past versions Solaris Cluster used to launch an xntpd instances at boot time using rc scripts. Now Solaris
Cluster 3.3 3/13 (udpdate2) and 4.x have been modified to make use of the native Solaris NTP services that are handled by
SMF framework and do also make use of the standard ntp.conf file as long this is setup. Additionally the default NTP
configuration files provided by the Solaris Cluster software have been reworked to make room for these changes.

SOLUTION

Usage of NTP within a Solaris Cluster environment shall observe the following guidelines:

Synchronization – The primary requirement when you configure NTP is that all cluster nodes must be synchronized to
the same time.
Accuracy – Consider accuracy of time on individual nodes to be of secondary importance to the synchronization of time
among nodes.
You are free to configure NTP as best meets your individual needs if this basic requirement for synchronization is met.

Any node forced to use just its own local clock could see its time to drift apart with respect other nodes. As result, it is prudent
to have a configuration that provide redundancy in face of failure of one NTP server.
This can be achieved either by using more than one NTP server or by setting the nodes to use one NTP server but also to act
as peers so they agree upon a common time even if no server is running. Solaris Cluster Nodes are identified by their private
host names and time synchronization occurs across the cluster interconnect.

A) If you installed/configured your own /etc/inet/ntp.conf file then this configuration file will be used.

To configure NTP for your individual needs please refer to


Document 1010136.1 NTP Information and Setup
Document 1940415.1 ntpd - Network Time Protocol daemon Version 4 information

e.g: NTP provides two facilities:

Configuring an association in symmetric-active mode (usually indicated by a "peer" declaration in configuration files)
indicates that one wants to obtain time from the remote server, and is willing to supply time to it as well. This mode is
appropriate in configurations involving the cluster nodes.
Configuring an association in client mode (usually indicated by a "server" declaration in configuration files) indicates
that one wants to obtain time from the remote server, but is not willing to provide time to it.

B) If using the setup from Oracle Solaris Cluster  (SC):

Details for Solaris Cluster 3.3 3/13 update2 and Solaris Cluster 4.x:
If you do not have your own /etc/inet/ntp.conf file, the /etc/inet/ntp.conf and ntp.conf.sc file will be used as your NTP
configuration file automatically.

As mentioned since these SC versions NTP v4 will be selected within installation. When you install Solaris Cluster software the
'scinstall' command create a /etc/inet/ntp.conf from the provided template files (see /etc/inet/ntp.cluster and
/etc/inet/ntp.conf.sc). This establish a peer relationship between all cluster nodes. One node is designated the “preferred”
node. Nodes are identified by their private host names and time synchronization occurs across the cluster interconnect.

Check if the NTP v4 service is online in


Solaris 11 and SC 4.x:

# svcs svc:/network/ntp:default

If not run:

# svcadm enable svc:/network/ntp:default

Solaris 10 and SC 3.3 3/13:

# svcs svc:/network/ntp4:default

If not run:

# svcadm enable svc:/network/ntp4:default

NTP v4 service was introduced with Solaris 10 U8 10/09.


Document 1940415.1 ntpd - Network Time Protocol daemon Version 4 information

More details available in the


Oracle Solaris Cluster Software Installation Guide - Configuring Network Time Protocol (NTP):

Please notice that editing the cluster-supplied (created) ntp.conf template files require care to avoid unwanted interaction
between NTP directives.
See Document 1909818.1 Solaris Cluster Node/System/Server Do Not Sync Time with Newly Added NTP Server

Details for Solaris Cluster 3.0 until Solaris Cluster 3.3 5/11 update1:
If you do not have your own /etc/inet/ntp.conf file, the /etc/inet/ntp.conf.cluster file will be used as your NTP configuration file
automatically.

In these Solaris Cluster versions NTP v3 will be used. When you install Solaris Cluster software by using the scinstall
command, one step in the process is to configure NTP for the cluster and create the file /etc/inet/ntp.conf.cluster. Oracle
Solaris Cluster software supplies a template file, ntp.cluster (see /etc/inet/ntp.cluster on an installed cluster host), that
establishes a peer relationship between all cluster hosts. One host is designated the “preferred” host.

Example if using /etc/inet/ntp.conf.cluster file from Solaris Cluster:

1. Stop the cluster software in order to prevent nodes clock "leap" which could crash the cluster.

This is accomplished by shutting down the cluster with scshutdown(1M) or init(1M), as described in "How to Reset the Time of
Day in a Cluster"  and then doing a "boot -x" in all the nodes.

2.Verify the used private hostnames on the cluster:

# scconf -p|grep hostname


Node private hostname: clusternode1-priv
Node private hostname: clusternode2-priv

3. insert the external servers, for example

#
# The local (undisciplined Solaris) clock is identified as 127.127.1.0.
#
# Some type of primary clock is important; but, it does not have
# to be the local kernel clock.
#
#server 127.127.1.0
server xx.xx.xx.xxx
server xx.xx.xx.xxx
server xx.xx.xx.xxx
driftfile /etc/ntp.drift

4. Remove any unused private hostnames (see step 2), for example

#
# One of the "peers" should be "preferred" over the others.
#
peer clusternode1-priv prefer
peer clusternode2-priv
#peer clusternode3-priv

This step is NOT necessary if you are running Sun Cluster 3.1 8/05 Update4 or higher.

5. Customize the file as best your individual needs.


Refer to Document 1010136.1 NTP Information and Setup

6. Copy the NTP configuration file to all nodes in the cluster.


The contents of the NTP configuration file must be identical on all cluster nodes.

7. Rename /etc/inet/ntp.conf file in all nodes if this file exists


# mv /etc/inet/ntp.conf /etc/inet/ntp.conf.original

This file does NOT exist in a brand new installation of Solaris 10.

8. Stop the NTP daemon on each node.

# /etc/init.d/xntpd stop

Wait for the stop command to complete successfully on each node before you proceed to Step 9.

In Solaris 10, since we have the built in NTP daemon (Solaris 10 Service Management Facility compliant) and we also have the
daemon that comes with Sun Cluster 3.1 Update 4 or higher.

node1# uname -a
SunOS node1 5.10 Generic_118822-11 sun4u sparc SUNW,Sun-Fire-V210
node1# svcs -a | grep ntp
legacy_run 15:21:05 lrc:/etc/rc2_d/S72sc_update_ntp
legacy_run 15:21:06 lrc:/etc/rc2_d/S74xntpd_cluster
disabled 15:20:45 svc:/network/ntp:default

in the form of a legacy service (/etc/rc script) We want to disable the built in Solaris 10 NTP daemon if this is enabled

node1# svcs -a | grep ntp


online 5:53:31 svc:/network/ntp:default

by doing

# svcadm disable ntp

9. Restart the NTP daemon on each node.

# /etc/init.d/xntpd.cluster start

The xntpd.cluster startup script first looks for the /etc/inet/ntp.conf file. If that file exists, the script exits immediately without
starting the NTP daemon. If the ntp.conf file does not exist but the ntp.conf.cluster file does exist, the script starts the NTP
daemon by using the ntp.conf.cluster file as the NTP configuration file.

10. Verify time synchronization between the external time sources and all cluster nodes:

# ntpq -p => Print a list of the server's peers.


# date => Verify the date between NTP Server and each node.
# ps -ef | grep xntpd => Verify the xntpd daemon.

Finally once this has been completed, you can boot all the nodes back normally into cluster mode.

IMPORTANT if NTP will not start after installation of patch 145333-20 or 145334-20:

In Solaris Cluster 3.3 3/13 update2 the xntp files were removed due to implementation of
BUG 15678195 - SUNBT6996086-4.0 xntpd.cluster does not work on Solaris 11

Basically this means, Solaris Cluster will no longer ship its own run level scripts to start the NTP service. Instead it will use
the NTP SMF service from Solaris. Due to this changes which happen between Solaris Cluster 3.3 5/11 update1 and
Solaris Cluster 3.3 3/13 update2 (and SunPatch 145333-20 there is a possibility that the NTP services will not start.
Therefore staring with Solaris Cluster 3.3 SunPatch 145333-20 we see the following files modified/deleted when
installed. This affects NTP/XNTP in an Oracle Solaris Cluster 3.3 environment.   
From patch readme of 145333-20:
/etc/inet/ntp.cluster
/etc/init.d/sc_update_ntp
/etc/init.d/scpostconfig
/etc/init.d/xntpd.cluster *(deleted)*
/etc/rc0.d/K40xntpd.cluster *(deleted)*
/etc/rc1.d/K40xntpd.cluster *(deleted)*
/etc/rc2.d/K40xntpd.cluster *(deleted)*
/etc/rc2.d/S72sc_update_ntp
/etc/rc2.d/S74xntpd.cluster *(deleted)*

The workaround to start NTP services when 145333-20 (sparc) or 145334-20 (x86) was installed is:
If /etc/ntp.conf does not exist run
# /usr/cluster/lib/sc/sc_update_ntp initialize
This new script creates ntp.conf, enables the NTP service and starts ntpd

The solution for this issue is use:


SunPatch 145333-24 or higher Oracle Solaris Cluster 3.3: Core Patch for Oracle Solaris 10
SunPatch 145334-24 or higher Oracle Solaris Cluster 3.3_x86: Core Patch for Oracle Solaris 10_x86

This issue is NOT in Solaris Cluster 4.x

IMPORTANT  if using Oracle Clusterware 11g on Solaris with or without Solaris Cluster:

The Oracle Clusterware requires for NTP:


slewalways yes
disable pll                 (only for NTP v3 (xntp), NTP v4 (ntpd) will set this automatically see Document 1940415.1)

To do this on:
A) Solaris 10 with NTP v3 (xntp), with or without Solaris Cluster and using external NTP server
Edit the /etc/inet/ntp.conf file to add "slewalways yes" and "disable pll" to the file.
Afterwards restart xntpd using the command /usr/sbin/svcadm restart ntp.

B) Solaris 11 with NTP v4 (ntpd), with or without Solaris Cluster


 # svccfg -s svc:/network/ntp:default setprop config/slew_always = true
 # svcadm refresh svc:/network/ntp:default
 # svcadm restart svc:/network/ntp:default

In Solaris 11 the command 'svcadm restart svc:/network/ntp:default' will restart NTP version4 (ntpd) and in case of Solaris
10 this command will restart NTP version3 (xntp). More details in Document 1010136.1 and Document 1940415.1.

C) Solaris 10 with NTP v4 (ntpd), with or without Solaris Cluster


 # svccfg -s svc:/network/ntp4:default setprop config/slew_always = true
 # svcadm refresh svc:/network/ntp4:default
 # svcadm restart svc:/network/ntp4:default

D) Solaris 10 with NTP v3 (xntp), with Solaris Cluster and using Solaris Cluster setup files
Edit the /etc/inet/ntp.conf.cluster file to add "slewalways yes" and "disable pll" to the file.
Afterwards restart xntpd using the command /usr/sbin/svcadm restart ntp.

More infos available in Oracle Grid Infrastructure Installation Guide 11g Release 2 (11.2) for Oracle Solaris - 2.14 Network
Time Protocol Setting.

 
Information about 'leap second' handling in Solaris Cluster

A one second step won't be a problem for Solaris Cluster. So, no specifics for Soalris Cluster.
Additional info in
Document 1019692.1 Leap Second Handling in Solaris - NTPv3 and NTPv4

Still have questions? Consider posting them in the Oracle Solaris Volume Manager Community.

REFERENCES

NOTE:1010136.1 - NTP Information and Setup

BUG:15678195 - SUNBT6996086-4.0 XNTPD.CLUSTER DOES NOT WORK ON SOLARIS 11


NOTE:1940415.1 - ntpd - Network Time Protocol daemon Version 4 information
Didn't find what you are looking for?

Das könnte Ihnen auch gefallen