scan ip的手動切換

Davis_itpub發表於2018-06-27

檢查RAC的狀態,從狀態資訊可以看到scan_listener 執行在rac-1節點。

[grid@rac-1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.LISTENER_RAC.lsnr
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.ORADATA.dg
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.ORC_VOTE.dg
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.asm
               ONLINE  ONLINE       rac-1                    Started            
               ONLINE  ONLINE       rac-2                    Started            
ora.gsd
               OFFLINE OFFLINE      rac-1                                       
               OFFLINE OFFLINE      rac-2                                       
ora.net1.network
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.ons
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.registry.acfs
               OFFLINE OFFLINE      rac-1                                       
               ONLINE  ONLINE       rac-2                                       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac-1
                                       
ora.cvu
      1        ONLINE  ONLINE       rac-1                                       
ora.oc4j
      1        ONLINE  ONLINE       rac-1                                       
ora.oratest.db
      1        ONLINE  ONLINE       rac-2                    Open               
      2        ONLINE  ONLINE       rac-1                    Open               
ora.rac-1.vip
      1        ONLINE  ONLINE       rac-1                                       
ora.rac-2.vip
      1        ONLINE  ONLINE       rac-2                                       
ora.scan1.vip
      1        ONLINE  ONLINE       rac-1                                       
[grid@rac-1 ~]$

進一步確認scan ip 和 scan listener 執行在那個節點

[grid@rac-1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac-1

[grid@rac-1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac-1

從資訊看,scan ip 執行在rac-1 節點。下面手動將scan ip 切換到rac-2 節點

我們將使用srvctl relocate scan_listener命令,下面是這個命令的幫助文件

[grid@rac-1 ~]$ srvctl relocate scan_listener -help

Temporarily relocate SCAN listener from one node of the cluster to another.

Usage: srvctl relocate scan_listener -i <ordinal_number> [-n <node_name>]
    -i <scan_ordinal_number> Ordinal number of IP address
    -n <node_name>           SCAN VIP node name
    -h                       Print usage
[grid@rac-1 ~]$

執行該命令

[grid@rac-1 ~]$ srvctl relocate scan_listener -i 1 -n rac-2

檢查scan ip 資訊,發現scan ip 已經執行在rac-2節點了。

[grid@rac-1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac-2

[grid@rac-1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac-2

[grid@rac-1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.LISTENER_RAC.lsnr
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.ORADATA.dg
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.ORC_VOTE.dg
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.asm
               ONLINE  ONLINE       rac-1                    Started            
               ONLINE  ONLINE       rac-2                    Started            
ora.gsd
               OFFLINE OFFLINE      rac-1                                       
               OFFLINE OFFLINE      rac-2                                       
ora.net1.network
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.ons
               ONLINE  ONLINE       rac-1                                       
               ONLINE  ONLINE       rac-2                                       
ora.registry.acfs
               OFFLINE OFFLINE      rac-1                                       
               ONLINE  ONLINE       rac-2                                       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac-2                                       
ora.cvu
      1        ONLINE  ONLINE       rac-1                                       
ora.oc4j
      1        ONLINE  ONLINE       rac-1                                       
ora.oratest.db
      1        ONLINE  ONLINE       rac-2                    Open               
      2        ONLINE  ONLINE       rac-1                    Open               
ora.rac-1.vip
      1        ONLINE  ONLINE       rac-1                                       
ora.rac-2.vip
      1        ONLINE  ONLINE       rac-2                                       
ora.scan1.vip
      1        ONLINE  ONLINE       rac-2                                       
[grid@rac-1 ~]$

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

相關文章