Oracle RAC 私有網路 (Interconnect) 承載 Cache Fusion 與心跳,網卡故障或擴容需更換介面。11gR2 起網路配置遷移至 GPNP Profile XML,不再存於 OCR。本文記錄真實雙節點 RAC (11.2.0.4) 將私網從 eth3 (192.168.2.0) 遷移至 eth1/eth2 (192.168.1.0) 的完整操作流程:備份 GPNP、OIFCFG 新增/刪除介面、叢集滾動重啟、驗證。
| 版本 | 網路配置存儲 | 管理工具 |
| 11gR1 及以前 | OCR | OIFCFG 直接修改 OCR |
| 11gR2+ | GPNP Profile ($GI_HOME/gpnp//profiles/peer/profile.xml) | OIFCFG 修改 GPNP,需叢集重啟生效 |
三、操作步驟詳記
1. 備份 GPNP Profile (每節點必做)
# 節點 rac-one
[grid@rac-one]$ cd /u01/app/11.2.0/grid/gpnp/rac-one/profiles/peer/
[grid@rac-one]$ cp profile.xml profile.xml_bak
# 節點 rac-two
[grid@rac-two]$ cd /u01/app/11.2.0/grid/gpnp/rac-two/profiles/peer/
[grid@rac-two]$ cp profile.xml profile.xml_bak
2. 查看當前網路配置
[grid@rac-one]$ oifcfg getif
eth0 192.168.4.0 global public
eth3 192.168.2.0 global cluster_interconnect
[grid@rac-one]$ oifcfg iflist -p -n
eth0 192.168.4.0 PRIVATE 255.255.255.0
eth1 192.168.1.0 PRIVATE 255.255.255.0
eth2 192.168.1.0 PRIVATE 255.255.255.0
eth3 192.168.2.0 PRIVATE 255.255.255.0
eth3 169.254.0.0 UNKNOWN 255.255.0.0
確認 eth1、eth2 已配置 IP 且可用。
3. 新增新的 Interconnect 介面 (任一節點執行,全域生效)
[grid@rac-one]$ oifcfg setif -global eth1/192.168.1.0:cluster_interconnect
[grid@rac-one]$ oifcfg setif -global eth2/192.168.1.0:cluster_interconnect
4. 驗證新增結果
[grid@rac-one]$ oifcfg getif
eth0 192.168.4.0 global public
eth3 192.168.2.0 global cluster_interconnect
eth1 192.168.1.0 global cluster_interconnect
eth2 192.168.1.0 global cluster_interconnect
5. 刪除舊的 Interconnect 介面
[grid@rac-two]$ oifcfg delif -global eth3/192.168.2.0
6. 滾動重啟叢集 (關鍵:先停後啟,逐節點)
# 節點 rac-one
[root@rac-one]$ $GI_HOME/bin/crsctl stop crs
[root@rac-one]$ $GI_HOME/bin/crsctl disable crs
[root@rac-one]$ $GI_HOME/bin/crsctl enable crs
[root@rac-one]$ $GI_HOME/bin/crsctl start crs
# 節點 rac-two (同步操作)
[root@rac-two]$ $GI_HOME/bin/crsctl stop crs
[root@rac-two]$ $GI_HOME/bin/crsctl enable crs
[root@rac-two]$ $GI_HOME/bin/crsctl start crs
注意:disable/enable 確保自動啟動狀態正確;生產環境建議單節點滾動,避免全叢集同時離線。
7. 最終驗證
[grid@rac-two]$ oifcfg getif
eth0 192.168.4.0 global public
eth1 192.168.1.0 global cluster_interconnect
eth2 192.168.1.0 global cluster_interconnect
[grid@rac-two]$ crsctl status resource -t
# 確認 ora.cluster_interconnect.haip、ora.net1.network 等資源 ONLINE
四、常見坑點與避坑
| 坑點 | 後果 | 對策 |
| 未備份 profile.xml | 配置錯誤無法回滾 | 強制要求雙節點備份 |
| 新介面 IP 未配置/不通 | HAIP 無法建立、節點驅逐 | 先用 ping/ssh 驗證節點間互通 |
| 直接刪除舊介面未新增新介面 | 叢集失去 interconnect、Split Brain | 嚴格遵循「先增後刪」 |
| 未滾動重啟 | 配置不生效、資源狀態異常 | 必須 crsctl stop/start crs |
| GPNP XML 手動編輯 | 格式錯誤導致 GI 啟動失敗 | 禁用手動編輯,僅用 OIFCFG |
五、延伸場景
- 修改 MTU:OS 層調整網卡 MTU (如 9000),GPNP 自動感知
- 變更子網/掩碼:同樣走
setif/delif 流程,確保新網段路由通達
- 多 Interconnect 負載均衡:11gR2 支援最多 4 個
cluster_interconnect,HAIP 自動負載分發
RAC 私網變更屬高風險操作,務必在維護窗口、備份完整、驗證網通後執行,「先增後刪、滾動重啟」是鐵律。
- 上一篇文章: Oracle 資料庫補丁查詢指南:v$version 與 OPatch lsinventory 雙重驗證
- 下一篇文章: 解決 ORA-12560: TNS:協議適配器錯誤:正確設定 ORACLE_SID 登入資料庫
Copyright ©
程式碼之家 All Rights Reserved