以前我安装rac的同步都是用的ntp,后来oracle引入ctss,以下为官方介绍
The Cluster Time Synchronization Service (CTSS) is installed as part of Oracle Clusterware. By default the CTSS 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
简单来说 就是ctss是作为grid的一部分安装完成,会自动检查服务器上是否有安装其他时间同步服务。如果没有那么ctss就会自动生效。
如果ctss本身就处于active模式,当有新的节点加入进来时,会将新节点的时间与cluster的引用时间比较差值,如果这个差值在一定范围内,则ctss对其进行同步。如果超出了这个范围,ctss会执行slew time synchronization
,将新节点的时间增速加快或者调慢,直到与引用时间同步。
当cluster启动时,ctss也随之启动并以active模式运行,当发现时间差值超过限制(为24小时),则ctss会在alert.log生成一条日志,然后cluster会启动失败,必须手动对新加入的节点进行时间调整。
检查集群是否存在第三方时间同步服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 [grid@rac1 ~]$ 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/chrony.conf' ...PASSED Verifying '/var/run/ntpd.pid' ...WARNING (PRVG-1019) Verifying '/var/run/chronyd.pid' ...WARNING (PRVG-1019) Verifying Daemon 'ntpd' ...FAILED (PRVG-1024, PRVF-7590) Verifying Daemon 'chronyd' ...FAILED (PRVG-1024, PRVF-7590) Verifying Network Time Protocol (NTP) ...FAILED (PRVG-1019, PRVG-1024, PRVF-7590) Verifying Clock Synchronization ...FAILED (PRVG-1019, PRVG-1024, PRVF-7590) 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 Verifying '/var/run/ntpd.pid' ...WARNING PRVG-1019 : The NTP configuration file "/var/run/ntpd.pid" does not exist on nodes "rac2,rac1" Verifying '/var/run/chronyd.pid' ...WARNING PRVG-1019 : The NTP configuration file "/var/run/chronyd.pid" does not exist on nodes "rac2,rac1" Verifying Daemon 'ntpd' ...FAILED PRVG-1024 : The NTP daemon or Service was not running on any of the cluster nodes. rac2: PRVF-7590 : "ntpd" is not running on node "rac2" rac2: Liveness check failed for "ntpd" rac1: PRVF-7590 : "ntpd" is not running on node "rac1" rac1: Liveness check failed for "ntpd" Verifying Daemon 'chronyd' ...FAILED PRVG-1024 : The NTP daemon or Service was not running on any of the cluster nodes. rac2: PRVF-7590 : "chronyd" is not running on node "rac2" rac2: Liveness check failed for "chronyd" rac1: PRVF-7590 : "chronyd" is not running on node "rac1" rac1: Liveness check failed for "chronyd" CVU operation performed: Clock Synchronization across the cluster nodes Date: Sep 20, 2018 4:01:05 PM CVU home: /u01/app/12.2.0/grid/ User: grid
检查ctss的状态
1 2 [grid@rac1 ~]$ crsctl check ctss CRS-4700: The Cluster Time Synchronization Service is in Observer mode
删除第三方时间同步配置文件
1 2 3 rm -rf /etc/ntp.conf rm -rf /etc/chrony.conf rm -rf /var/run/chronyd.pid
过大概半分钟 就可以看到状态变成了active模式
1 2 3 [grid@rac1 ~]$ crsctl check ctss CRS-4701: The Cluster Time Synchronization Service is in Active mode. CRS-4702: Offset (in msec): 0
同时在crs alert里会看到一条记录
1 2 3 /u01/app/grid/diag/crs/rac1/crs/trace/alert.log 2018-09-20 16:16:33.139 [OCTSSD(2801)]CRS-2410: The Cluster Time Synchronization Service on host rac1 is in active mode.
再次检查集群时间同步
1 2 3 4 5 6 7 8 9 10 [grid@rac1 ~]$ 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: Sep 20, 2018 5:02:48 PM CVU home: /u01/app/12.2.0/grid/ User: grid