Applies to:
Oracle Server - Enterprise Edition - Version 11.2.0.1 and later
Generic Linux
Purpose
An example of Linux OS NTP setup to use with Oracle Clusterware 11g R2 (observer mode of Cluster Time Synchronization Service, CTSS).
Scope
Database Administrator (DBA) who wants to set up NTP software included in Linux OS (Oracle Enterprise Linux).
Details
1. NTP Client Configuration
1.1. Create NTP configuration file (/etc/ntp.conf) then add NTP server(s)
# vi /etc/ntp.conf
...
server austin1q7-swi-9-rtr-1.us.oracle.com
server austin1q7-swi-10-rtr-1.us.oracle.com
...
:wq
#
1.2. Create configuration file (/etc/sysconfig/ntpd) for NTP daemon
(/usr/sbin/ntpd)
-x option must be used for Oracle RAC
# vi
/etc/sysconfig/ntpd
...
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
...
:wq
#
2. Testing NTP Time Synchronization
Time update can be done by starting ntpd or running "ntpd -q"
(ntpdate)
2.1. By starting NTP daemon
# /sbin/service ntpd
stop
# /sbin/service ntpd status
2.2. By running "ntpd -q"
# /usr/sbin/ntpd -q
ntpd: time set +225.433296s
#
3. Reviewing log of NTP daemon
By default, log of NTP daemon is written to OS log file
# cd /var/run
# tail -f messages
3.1. Time synchronization is done
/var/run/messages
...
Mar 25 03:54:42 celvpint1303 ntpd[17479]: ntpd 4.2.2p1@1.1570-o Tue Aug 21
17:49:20 UTC 2007 (1)
Mar 25 03:54:42 celvpint1303 ntpd[17479]: precision = 1.000 usec
...
Mar 25 03:54:51 celvpint1303 ntpd[17479]: synchronized to 144.20.15.203,
stratum 2
Mar 25 03:58:37 celvpint1303 ntpd[17479]: time reset +225.433296 s
3.2. Time synchronization is not done with a reason
Mar 24 11:09:57
celvpint1303 ntpd[17522]:
time correction of 61468 seconds exceeds sanity limit (1000);
set clock manually to the correct UTC time.
Mar 25 13:27:26 celvpint1303 ntpd[17542]:
time correction of -32396 seconds exceeds sanity limit (1000);
set clock manually to the correct UTC time.
3.3 NTPD log file configuration
# man ntpd
...
-l logfile
Specify the name and path of the log file. The default is the sys-
tem log file. This is the same operation as the logfile logfile
configuration command.
...
4. Debug output of NTP daemon
4.1. Debug output is printed to standard ouput or standard error
# man ntpd
...
-d Specify debugging mode. This option may occur more than once, with
each occurrence indicating greater detail of display.
-D level
Specify debugging level directly.
...
4.2. An example of debug output
# /sbin/service ntpd
restart
Shutting down ntpd: [FAILED]
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: ntpd 4.2.2p1@1.1570-o Tue Aug 21 17:49:20 UTC 2007 (1)
addto_syslog: precision = 1.000 usec
create_sockets(123)
addto_syslog: ntp_io: estimated max descriptors: 1024, initial socket boundary:
16
bind() fd 16, family 2, port 123, addr 0.0.0.0, flags=9
Added addr 0.0.0.0 to list of addresses
...
浙公网安备 33010602011771号