Beruflich Dokumente
Kultur Dokumente
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.
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.
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.
# svcs svc:/network/ntp:default
If not run:
# svcs svc:/network/ntp4:default
If not run:
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.
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.
#
# 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.
This file does NOT exist in a brand new installation of Solaris 10.
# /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
by doing
# /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:
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
IMPORTANT if using Oracle Clusterware 11g on Solaris with or without Solaris Cluster:
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.
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.
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