RAC的VIP切換測試
Oracle 10g開始推出VIP,能夠幫助資料庫或者程式能夠快速地進行failover。
本文主要測試RAC如何進行VIP的failover。
1. 原來的資源狀況
[root@dwdb01 suk]# crs_stat
HA Resource Target State
----------- ------ -----
ora.dwdb01.ASM1.asm ONLINE ONLINE on dwdb01
ora.dwdb01.LISTENER_DWDB01.lsnr ONLINE ONLINE on dwdb01
ora.dwdb01.gsd ONLINE ONLINE on dwdb01
ora.dwdb01.ons ONLINE ONLINE on dwdb01
ora.dwdb01.vip ONLINE ONLINE on dwdb01
ora.dwdb02.ASM2.asm ONLINE ONLINE on dwdb02
ora.dwdb02.LISTENER_DWDB02.lsnr ONLINE ONLINE on dwdb02
ora.dwdb02.gsd ONLINE ONLINE on dwdb02
ora.dwdb02.ons ONLINE ONLINE on dwdb02
ora.dwdb02.vip ONLINE ONLINE on dwdb02
ora.dwdb03.ASM3.asm ONLINE ONLINE on dwdb03
ora.dwdb03.LISTENER_DWDB03.lsnr ONLINE ONLINE on dwdb03
ora.dwdb03.gsd ONLINE ONLINE on dwdb03
ora.dwdb03.ons ONLINE ONLINE on dwdb03
ora.dwdb03.vip ONLINE ONLINE on dwdb03
ora.dwdb04.ASM4.asm ONLINE ONLINE on dwdb04
ora.dwdb04.LISTENER_DWDB04.lsnr ONLINE ONLINE on dwdb04
ora.dwdb04.gsd ONLINE ONLINE on dwdb04
ora.dwdb04.ons ONLINE ONLINE on dwdb04
ora.dwdb04.vip ONLINE ONLINE on dwdb04
ora.dwrac.db ONLINE ONLINE on dwdb02
ora.dwrac.dw.cs ONLINE ONLINE on dwdb04
ora.dwrac.dw.dwrac1.srv ONLINE ONLINE on dwdb01
ora.dwrac.dw.dwrac2.srv ONLINE ONLINE on dwdb02
ora.dwrac.dw.dwrac3.srv ONLINE ONLINE on dwdb03
ora.dwrac.dw.dwrac4.srv ONLINE ONLINE on dwdb04
ora.dwrac.dwrac1.inst ONLINE ONLINE on dwdb01
ora.dwrac.dwrac2.inst ONLINE ONLINE on dwdb02
ora.dwrac.dwrac3.inst ONLINE ONLINE on dwdb03
ora.dwrac.dwrac4.inst ONLINE ONLINE on dwdb04
------------------------
7 STATE=ONLINE on dwdb01
8 STATE=ONLINE on dwdb02
7 STATE=ONLINE on dwdb03
8 STATE=ONLINE on dwdb04
可以看到,所有資源都是正常online的,且VIP分佈執行在各自的節點中。
2. 把其中一個節點(dwdb04)的crs關掉,模擬故障
關閉例項不會導致VIP切換,VIP屬於nodeapp資源,因此,需要關閉crs來模擬節點或者crs故障才能觀察VIP切換。
[root@dwdb04 ~]# /oracle/product/10.2.0/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
3. 觀察crs_stat的變化
1) 停止crs後立刻在其他節點檢視crs_stat:
[root@dwdb01 suk]# crs_stat
HA Resource Target State
----------- ------ -----
ora.dwdb01.ASM1.asm ONLINE ONLINE on dwdb01
ora.dwdb01.LISTENER_DWDB01.lsnr ONLINE ONLINE on dwdb01
ora.dwdb01.gsd ONLINE ONLINE on dwdb01
ora.dwdb01.ons ONLINE ONLINE on dwdb01
ora.dwdb01.vip ONLINE ONLINE on dwdb01
ora.dwdb02.ASM2.asm ONLINE ONLINE on dwdb02
ora.dwdb02.LISTENER_DWDB02.lsnr ONLINE ONLINE on dwdb02
ora.dwdb02.gsd ONLINE ONLINE on dwdb02
ora.dwdb02.ons ONLINE ONLINE on dwdb02
ora.dwdb02.vip ONLINE ONLINE on dwdb02
ora.dwdb03.ASM3.asm ONLINE ONLINE on dwdb03
ora.dwdb03.LISTENER_DWDB03.lsnr ONLINE ONLINE on dwdb03
ora.dwdb03.gsd ONLINE ONLINE on dwdb03
ora.dwdb03.ons ONLINE ONLINE on dwdb03
ora.dwdb03.vip ONLINE ONLINE on dwdb03
ora.dwdb04.ASM4.asm ONLINE OFFLINE
ora.dwdb04.LISTENER_DWDB04.lsnr ONLINE OFFLINE
ora.dwdb04.gsd ONLINE OFFLINE
ora.dwdb04.ons ONLINE OFFLINE
ora.dwdb04.vip ONLINE OFFLINE
ora.dwrac.db ONLINE ONLINE on dwdb02
ora.dwrac.dw.cs ONLINE OFFLINE
ora.dwrac.dw.dwrac1.srv ONLINE ONLINE on dwdb01
ora.dwrac.dw.dwrac2.srv ONLINE ONLINE on dwdb02
ora.dwrac.dw.dwrac3.srv ONLINE ONLINE on dwdb03
ora.dwrac.dw.dwrac4.srv ONLINE OFFLINE
ora.dwrac.dwrac1.inst ONLINE ONLINE on dwdb01
ora.dwrac.dwrac2.inst ONLINE ONLINE on dwdb02
ora.dwrac.dwrac3.inst ONLINE ONLINE on dwdb03
ora.dwrac.dwrac4.inst ONLINE OFFLINE
------------------------
8 STATE=OFFLINE
7 STATE=ONLINE on dwdb01
8 STATE=ONLINE on dwdb02
7 STATE=ONLINE on dwdb03
可以看到,dwdb04的VIP資源此時處於offline狀態。
2) 隔一會再檢視crs_stat
[root@dwdb01 suk]# crs_stat
HA Resource Target State
----------- ------ -----
ora.dwdb01.ASM1.asm ONLINE ONLINE on dwdb01
ora.dwdb01.LISTENER_DWDB01.lsnr ONLINE ONLINE on dwdb01
ora.dwdb01.gsd ONLINE ONLINE on dwdb01
ora.dwdb01.ons ONLINE ONLINE on dwdb01
ora.dwdb01.vip ONLINE ONLINE on dwdb01
ora.dwdb02.ASM2.asm ONLINE ONLINE on dwdb02
ora.dwdb02.LISTENER_DWDB02.lsnr ONLINE ONLINE on dwdb02
ora.dwdb02.gsd ONLINE ONLINE on dwdb02
ora.dwdb02.ons ONLINE ONLINE on dwdb02
ora.dwdb02.vip ONLINE ONLINE on dwdb02
ora.dwdb03.ASM3.asm ONLINE ONLINE on dwdb03
ora.dwdb03.LISTENER_DWDB03.lsnr ONLINE ONLINE on dwdb03
ora.dwdb03.gsd ONLINE ONLINE on dwdb03
ora.dwdb03.ons ONLINE ONLINE on dwdb03
ora.dwdb03.vip ONLINE ONLINE on dwdb03
ora.dwdb04.ASM4.asm ONLINE OFFLINE
ora.dwdb04.LISTENER_DWDB04.lsnr ONLINE OFFLINE
ora.dwdb04.gsd ONLINE OFFLINE
ora.dwdb04.ons ONLINE OFFLINE
ora.dwdb04.vip ONLINE ONLINE on dwdb01
ora.dwrac.db ONLINE ONLINE on dwdb02
ora.dwrac.dw.cs ONLINE ONLINE on dwdb03
ora.dwrac.dw.dwrac1.srv ONLINE ONLINE on dwdb01
ora.dwrac.dw.dwrac2.srv ONLINE ONLINE on dwdb02
ora.dwrac.dw.dwrac3.srv ONLINE ONLINE on dwdb03
ora.dwrac.dw.dwrac4.srv ONLINE OFFLINE
ora.dwrac.dwrac1.inst ONLINE ONLINE on dwdb01
ora.dwrac.dwrac2.inst ONLINE ONLINE on dwdb02
ora.dwrac.dwrac3.inst ONLINE ONLINE on dwdb03
ora.dwrac.dwrac4.inst ONLINE OFFLINE
------------------------
6 STATE=OFFLINE
8 STATE=ONLINE on dwdb01
8 STATE=ONLINE on dwdb02
8 STATE=ONLINE on dwdb03
可以看到,dwdb04的VIP已經切換到節點dwdb01了,說明VIP的failover已經成功發生了。
4. 重啟啟動dwdb04的crs,模擬故障節點恢復
[root@dwdb04 ~]# /oracle/product/10.2.0/crs/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@dwdb04 ~]#
[root@dwdb01 suk]# crs_stat
HA Resource Target State
----------- ------ -----
ora.dwdb01.ASM1.asm ONLINE ONLINE on dwdb01
ora.dwdb01.LISTENER_DWDB01.lsnr ONLINE ONLINE on dwdb01
ora.dwdb01.gsd ONLINE ONLINE on dwdb01
ora.dwdb01.ons ONLINE ONLINE on dwdb01
ora.dwdb01.vip ONLINE ONLINE on dwdb01
ora.dwdb02.ASM2.asm ONLINE ONLINE on dwdb02
ora.dwdb02.LISTENER_DWDB02.lsnr ONLINE ONLINE on dwdb02
ora.dwdb02.gsd ONLINE ONLINE on dwdb02
ora.dwdb02.ons ONLINE ONLINE on dwdb02
ora.dwdb02.vip ONLINE ONLINE on dwdb02
ora.dwdb03.ASM3.asm ONLINE ONLINE on dwdb03
ora.dwdb03.LISTENER_DWDB03.lsnr ONLINE ONLINE on dwdb03
ora.dwdb03.gsd ONLINE ONLINE on dwdb03
ora.dwdb03.ons ONLINE ONLINE on dwdb03
ora.dwdb03.vip ONLINE ONLINE on dwdb03
ora.dwdb04.ASM4.asm ONLINE ONLINE on dwdb04
ora.dwdb04.LISTENER_DWDB04.lsnr ONLINE ONLINE on dwdb04
ora.dwdb04.gsd ONLINE ONLINE on dwdb04
ora.dwdb04.ons ONLINE ONLINE on dwdb04
ora.dwdb04.vip ONLINE ONLINE on dwdb04
ora.dwrac.db ONLINE ONLINE on dwdb02
ora.dwrac.dw.cs ONLINE ONLINE on dwdb03
ora.dwrac.dw.dwrac1.srv ONLINE ONLINE on dwdb01
ora.dwrac.dw.dwrac2.srv ONLINE ONLINE on dwdb02
ora.dwrac.dw.dwrac3.srv ONLINE ONLINE on dwdb03
ora.dwrac.dw.dwrac4.srv ONLINE ONLINE on dwdb04
ora.dwrac.dwrac1.inst ONLINE ONLINE on dwdb01
ora.dwrac.dwrac2.inst ONLINE ONLINE on dwdb02
ora.dwrac.dwrac3.inst ONLINE ONLINE on dwdb03
ora.dwrac.dwrac4.inst ONLINE ONLINE on dwdb04
------------------------
7 STATE=ONLINE on dwdb01
8 STATE=ONLINE on dwdb02
8 STATE=ONLINE on dwdb03
7 STATE=ONLINE on dwdb04
可以看到,當故障節點恢復了,dwdb04的VIP資源又從dwdb01切換回來了。
5. 模擬看看多個節點發生故障的情況
[root@dwdb02 suk]# /oracle/product/10.2.0/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@dwdb03 orion]# /oracle/product/10.2.0/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@dwdb04 ~]# /oracle/product/10.2.0/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@dwdb01 suk]# crs_stat
HA Resource Target State
----------- ------ -----
ora.dwdb01.ASM1.asm ONLINE ONLINE on dwdb01
ora.dwdb01.LISTENER_DWDB01.lsnr ONLINE ONLINE on dwdb01
ora.dwdb01.gsd ONLINE ONLINE on dwdb01
ora.dwdb01.ons ONLINE ONLINE on dwdb01
ora.dwdb01.vip ONLINE ONLINE on dwdb01
ora.dwdb02.ASM2.asm ONLINE OFFLINE
ora.dwdb02.LISTENER_DWDB02.lsnr ONLINE OFFLINE
ora.dwdb02.gsd ONLINE OFFLINE
ora.dwdb02.ons ONLINE OFFLINE
ora.dwdb02.vip ONLINE ONLINE on dwdb01
ora.dwdb03.ASM3.asm ONLINE OFFLINE
ora.dwdb03.LISTENER_DWDB03.lsnr ONLINE OFFLINE
ora.dwdb03.gsd ONLINE OFFLINE
ora.dwdb03.ons ONLINE OFFLINE
ora.dwdb03.vip ONLINE ONLINE on dwdb01
ora.dwdb04.ASM4.asm ONLINE OFFLINE
ora.dwdb04.LISTENER_DWDB04.lsnr ONLINE OFFLINE
ora.dwdb04.gsd ONLINE OFFLINE
ora.dwdb04.ons ONLINE OFFLINE
ora.dwdb04.vip ONLINE ONLINE on dwdb01
ora.dwrac.db ONLINE ONLINE on dwdb01
ora.dwrac.dw.cs ONLINE ONLINE on dwdb01
ora.dwrac.dw.dwrac1.srv ONLINE ONLINE on dwdb01
ora.dwrac.dw.dwrac2.srv ONLINE OFFLINE
ora.dwrac.dw.dwrac3.srv ONLINE OFFLINE
ora.dwrac.dw.dwrac4.srv ONLINE OFFLINE
ora.dwrac.dwrac1.inst ONLINE ONLINE on dwdb01
ora.dwrac.dwrac2.inst ONLINE OFFLINE
ora.dwrac.dwrac3.inst ONLINE OFFLINE
ora.dwrac.dwrac4.inst ONLINE OFFLINE
------------------------
18 STATE=OFFLINE
12 STATE=ONLINE on dwdb01
可見,所有故障節點的VIP都切換到正常的節點(dwdb01)上。
簡單總結:
1. 一個節點或者crs發生故障時,VIP資源會自動切換到其他節點上。切換時間在1分鐘以內。
2. 只要不是全部的節點都發生故障,VIP都可以failover到正常的節點上。VIP一般優先切換到master節點上
2. 當故障節點恢復時,VIP又會自動恢復到原來的節點上
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/231499/viewspace-1044085/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL Orchestrator自動導換+VIP切換MySql
- Oracle RAC DG手動切換Oracle
- RAC+單例項DG的切換單例
- rac vip failback issueAI
- Oracle 12. 2 RAC public IP與vip 互換方法Oracle
- app 測試環境切換問題APP
- 【RAC】Oracle rac 如何修改公網及vipOracle
- Pytest 如何使用切換被測試環境
- Web自動化測試 五 ----- selenium的等待和切換Web
- Oracle RAC修改public, VIP, SCAN IPOracle
- MySQL高可用之MHA切換測試(switchover & failover)MySqlAI
- MySQL MHA部署 Part 7 MHA手動切換測試MySql
- rac 新增第二public ip 和 vip
- Oracle RAC序列效能測試Oracle
- 【RAC】Oracle RAC上線測試場景介紹Oracle
- Oracle RAC ASM磁碟組擴容時遇到的VIP漂移OracleASM
- 【RAC】RAC更換心跳地址和RAC更換儲存主要步驟
- 想了解下,app 自動化測試給的包是否都需要寫個步驟切換到測試環境APP
- 程式切換(上下文切換)
- 視訊場景切換檢測的FPGA實現FPGA
- keycloak~登入皮膚動態切換的嘗試
- 效能測試必備知識(6)- 如何檢視“CPU 上下文切換”
- 效能測試必備知識(5)- 深入理解“CPU 上下文切換”
- DG的切換操作
- 交換機測試
- 【rac故障】root.sh報錯Unable to get VIP info for new node
- 網路測試儀測試交換機的基本指標指標
- 棧切換
- 一鍵切換夜間模式、隱藏桌面,試試One Switch模式
- Appium 測試 Android 混合應用時,第二次切換到WebView時的定位問題APPAndroidWebView
- 切換UNDO(zt)
- ubuntu切換源Ubuntu
- Git分支切換Git
- 切換java版本Java
- 切換 PHP 版本PHP
- 微軟Win10 (1909)19H2版本具有可切換功能的雙軌測試微軟Win10
- UiAutomator2 測試 H5 頁面,切換 webview 後報沒有找到對應的 ChromeDriver 版本UIH5WebViewChrome
- 11g RAC 修改PUBLIC-IP、VIP、PRIV-IP、SCAN-IP