Oracle Cluster Time Management

Cluster Time Synchronization Service(CTSS)可以检测集群中节点之间的时间同步问题。CTSS被作为Oracle CLusterware的一部分进行安装。如果它检测到在系统中存在时间同步服务(比如NTP或Chrony)或者存在时间同步服务配置是valid或broken,那么它将以观察模式运行。例如,如果集群中的任何一个节点上 存在/etc/ntp.conf文件,那么就算没有运行时间同步服务CTSS也会以观察模式运行。如果CTSS在集群的任何一个节点上都没有检测到存在时间同步服务或时间同步服务配置信息,它就会变成主动模式运行并且对集群执行时间管理。如果CTSS在集群中的一个节点上以主动模式运行,在另一个节点上以观察模式运行,并且没有NTP,时间同步软件在运行,那么你可以通过创建一个名叫/etc/ntp.conf的文件来将CTSS修改为观察模式。对于CTSS改变为观察模式 会在alert.log中写入消息。当节点加入集群时,如果CTSS以主动模式运行时,那么它将会使用集群中存在引用时钟的节点与这些加入节点进行时间比较。如果两个时间之间存在差异并且这种差异在特定设置限制,那么CTSS将执行时间同步。集群中的时钟节点由于各种原因将不能使用引用时钟(CTSS用来作为基础的时间,它所在的节点是集群中第一个启动的节点)进行同步。当发生这种情况时,CTSS执行回转时间同步,它将加速或减慢节点上的系统时间直到它们与引 用系统时间处于同步状态。在这种时间同步方法中,CTSS不会向后调整时间,它将保证系统时间单向增加。

当Orale集群软件启动时,如果CTSS以主动模式运行并且时间差异超过了设置限制(限制为24小时),那么CTSS会在alert.log中生成一个告警,并退出,那么Oracle集群软件会启动失败。如果你必须手动对加入集群的节点进行时 间调整,在启动Oracle集群软件之后CTSS可以对这些节点管理时间。当执行回转时间同步时,CTSS从来不会使用引用时钟向后调整时间。CTSS定期写包含它如何使用引用时钟来调整节点时间的告警到alert.log中。

CTSS当出现以下情况下会向Oracle集群alert.log与syslog中写告警信息:
.检查到时间发生改变
.检查到与引用时钟相比存在着显著的时间差异
.从观察模式切换到主动模式或者从主动模式切换到观察模式

使用CTSS来同步集群中的时间可以促进对Oracle集群问题的诊断,因为不需要考虑不同节点上影响时间的一系列事件了。
激活与禁止集群时间同步
为了对集群设置定时间管理服务可以激活CTSS。如果想要使用不同的集群时间同步服务可以禁止CTSS。为了激活CTSS,必须要对集群中的所有节点停止与删除第三方的时间同步服务。当激活CTSS时会检查集群的时间管理服务方式。
下面的RAC因为所有节点存在第三方的时间同步服务配置信息使得CTSS以观察方式运行
检测集群节点是否存在第三方时间同步服务

[root@jytest1 ~]# find / -name ntp.conf
/etc/ntp.conf


[root@jytest2 ~]# find / -name ntp.conf
/etc/ntp.conf


[grid@jytest1 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...
CTSS is in Observer state. Switching over to clock synchronization checks using NTP

  Verifying Network Time Protocol (NTP) ...
    Verifying '/etc/ntp.conf' ...PASSED
    Verifying '/etc/chrony.conf' ...PASSED
    Verifying '/var/run/chronyd.pid' ...PASSED
    Verifying Daemon 'chronyd' ...PASSED
    Verifying NTP daemon or service using UDP port 123 ...PASSED
    Verifying chrony daemon is synchronized with at least one external time source ...FAILED (PRVG-13606)
  Verifying Network Time Protocol (NTP) ...FAILED (PRVG-1063)
Verifying Clock Synchronization ...FAILED (PRVG-1063, PRVG-13606)

Verification of Clock Synchronization across the cluster nodes was unsuccessful on all the specified nodes.


Failures were encountered during execution of CVU verification request "Clock Synchronization across the cluster nodes".

Verifying Clock Synchronization ...FAILED
  Verifying Network Time Protocol (NTP) ...FAILED
  PRVG-1063 : configuration files for more than one time synchronization
  service were found on nodes of the cluster
  configuration file "/etc/chrony.conf" was found on nodes "jytest2,jytest1"
  configuration file "/etc/ntp.conf" was found on nodes "jytest2,jytest1"

    Verifying chrony daemon is synchronized with at least one external time
    source ...FAILED
    jytest2: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest2".

    jytest1: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest1".


CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 12:58:07 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

[grid@jytest2 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...
CTSS is in Observer state. Switching over to clock synchronization checks using NTP

  Verifying Network Time Protocol (NTP) ...
    Verifying '/etc/ntp.conf' ...PASSED
    Verifying '/etc/chrony.conf' ...PASSED
    Verifying '/var/run/chronyd.pid' ...PASSED
    Verifying Daemon 'chronyd' ...PASSED
    Verifying NTP daemon or service using UDP port 123 ...PASSED
    Verifying chrony daemon is synchronized with at least one external time source ...FAILED (PRVG-13606)
  Verifying Network Time Protocol (NTP) ...FAILED (PRVG-1063)
Verifying Clock Synchronization ...FAILED (PRVG-1063, PRVG-13606)

Verification of Clock Synchronization across the cluster nodes was unsuccessful on all the specified nodes.


Failures were encountered during execution of CVU verification request "Clock Synchronization across the cluster nodes".

Verifying Clock Synchronization ...FAILED
  Verifying Network Time Protocol (NTP) ...FAILED
  PRVG-1063 : configuration files for more than one time synchronization
  service were found on nodes of the cluster
  configuration file "/etc/chrony.conf" was found on nodes "jytest2,jytest1"
  configuration file "/etc/ntp.conf" was found on nodes "jytest2,jytest1"

    Verifying chrony daemon is synchronized with at least one external time
    source ...FAILED
    jytest2: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest2".

    jytest1: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest1".


CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 1:11:12 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

使用grid用户执行crsctl check ctss命令来查看CTSS的运行模式,命令结果显示为观察模式

[grid@jytest1 ~]$ crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

[grid@jytest2 ~]$ crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

现在删除集群节点中的第三方时间同步服务

[root@jytest1 ~]# rm -rf /etc/ntp.conf
[root@jytest1 ~]# rm -rf /etc/chrony.conf
[root@jytest1 ~]# rm -rf /var/run/chronyd.pid


[root@jytest2 ~]# rm -rf /etc/ntp.conf
[root@jytest2 ~]# rm -rf /etc/chrony.conf
[root@jytest2 ~]# rm -rf /var/run/chronyd.pid

再次检查CTSS的运行模式,可以看到CTSS从观察模式变为了主动模式

[grid@jytest1 ~]$ crsctl check ctss
CRS-4701: The Cluster Time Synchronization Service is in Active mode.
CRS-4702: Offset (in msec): 100
[grid@jytest1 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...PASSED

Verification of Clock Synchronization across the cluster nodes was successful.

CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 1:14:39 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

[grid@jytest2 ~]$ crsctl check ctss
CRS-4701: The Cluster Time Synchronization Service is in Active mode.
CRS-4702: Offset (in msec): 0
[grid@jytest2 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...PASSED

Verification of Clock Synchronization across the cluster nodes was successful.

CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 1:15:14 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

One thought on “Oracle Cluster Time Management

发表评论

电子邮件地址不会被公开。