Oracle Cluster Time Management

531968912發表於2018-06-20

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

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

相關文章