在RAC中配置NTPD時間同步

zhangsharp20發表於2016-05-11
When the installer finds that the NTP protocol is not active, the Cluster Time 
Synchronization Service is installed in active mode and synchronizes the time across 
the nodes. If NTP is found configured, then the Cluster Time Synchronization Service 
is started in observer mode, and no active time synchronization is performed by 
Oracle Clusterware within the cluster. 
To confirm that ctssd is active after installation, enter the following command as the 
Grid installation owner:
$ crsctl check ctss
If you are using NTP, and you prefer to continue using it instead of Cluster Time 
Synchronization Service, then you need to modify the NTP configuration to set the -x 
flag, which prevents time from being adjusted backward. Restart the network time 
protocol daemon after you complete this task. 
To do this, on Oracle Linux, Red Hat Linux, and Asianux systems, edit the 
/etc/sysconfig/ntpd file to add the -x flag, as in the following example: 
# Drop root to id 'ntp:ntp' by default.
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
# Set to 'yes' to sync hw clock after successful ntpdate
SYNC_HWCLOCK=no
# Additional options for ntpdate
NTPDATE_OPTIONS=""
Then, restart the NTP service.
# /sbin/service ntp restart
On SUSE systems, modify the configuration file /etc/sysconfig/ntp with the 
following settings:
NTPD_OPTIONS="-x -u ntp"
Restart the daemon using the following command:
# service ntp restart

Cluster Time Management(叢集時間管理)

The Cluster Time Synchronization Service (CTSS) is installed as part of Oracle Clusterware and runs in observer mode if it detects a time synchronization service or a time synchronization service configuration, valid or broken, on the system. If CTSS detects that there is no time synchronization service or time synchronization service configuration on any node in the cluster, then CTSS goes into active mode and takes over time management for the cluster. When nodes join the cluster, if CTSS is in active mode, then it compares the time on those nodes to a reference clock located on one node in the cluster. If there is a discrepancy between the two times and the discrepancy is within a certain stepping limit, then CTSS performs step time synchronization, which is to step the time of the nodes joining the cluster to synchronize them with the reference.

When Oracle Clusterware starts, if CTSS is running in active mode and the time discrepancy is outside the stepping limit (the limit is 24 hours), then CTSS generates an alert in the alert log, exits, and Oracle Clusterware startup fails. You must manually adjust the time of the nodes joining the cluster to synchronize with the cluster, after which Oracle Clusterware can start and CTSS can manage the time for the nodes.

Clocks on the nodes in the cluster become desynchronized with the reference clock (a time CTSS uses as a basis and is on the first node started in the cluster) periodically for various reasons. When this happens, CTSS performs slew time synchronization, which is to speed up or slow down the system time on the nodes until they are synchronized with the reference system time. In this time synchronization method, CTSS does not adjust time backward, which guarantees monotonic increase of the system time.

When performing slew time synchronization, CTSS never runs time backward to synchronize with the reference clock. CTSS periodically writes alerts to the alert log containing information about how often it adjusts time on nodes to keep them synchronized with the reference clock.

To activate CTSS in your cluster, you must stop and deconfigure the vendor time synchronization service on all nodes in the cluster. CTSS detects when this happens and assumes time management for the cluster.

For example, to deconfigure NTP, you must remove or rename the ntp.conf file. Similarly, if you want to deactivate CTSS in your cluster, then do the following:
1. Configure the vendor time synchronization service on all nodes in the cluster. CTSS detects this change and reverts back to observer mode.
2. Use the crsctl check ctss command to ensure that CTSS is operating in observer mode.
3. Start the vendor time synchronization service on all nodes in the cluster.
4. Use the cluvfy comp clocksync -n all command to verify that the vendor time synchronization service is operating.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29802484/viewspace-2097762/,如需轉載,請註明出處,否則將追究法律責任。

相關文章