萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 資料庫 >> Oracle 教學

Oracle RAC 私有網絡網卡更換操作指南:11gR2 GPnP Profile 與 OIFCFG 實戰

一、背景與遷移場景

  • 新增/替換私網網卡 (模擬硬體故障、擴容、MTU 調整)。
  • 11gR2 起私網配置儲存於 **GPnP Profile (XML)**,不再寫入 OCR,操作工具統一為 oifcfg。

二、操作前備份 (每個節點)

# 節點 1
cd $GRID_HOME/gpnp/rac-one/profiles/peer/
cp profile.xml profile.xml_bak

# 節點 2
cd $GRID_HOME/gpnp/rac-two/profiles/peer/
cp profile.xml profile.xml_bak

三、查看當前私網介面

$ oifcfg getif
eth0  192.168.4.0  global  public
eth3  192.168.2.0  global  cluster_interconnect

$ oifcfg iflist -p -n
eth0  192.168.4.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  192.168.1.0  PRIVATE  255.255.255.0
eth2  192.168.1.0  PRIVATE  255.255.255.0

現狀:eth3 (192.168.2.0) 為當前 cluster_interconnect,計劃遷移至 eth1/eth2 (192.168.1.0)。

四、新增新介面為 Cluster Interconnect

# 任一節點執行即可 (GPnP 會推播至全叢集)
$ oifcfg setif -global eth1/192.168.1.0:cluster_interconnect
$ oifcfg setif -global eth2/192.168.1.0:cluster_interconnect

# 驗證
$ 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

五、移除舊介面

$ oifcfg delif -global eth3/192.168.2.0

# 最終驗證
$ 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

六、生效與驗證

  1. 重啟叢集 (10g 必須,11gR2 通常動態生效,建議滾動重啟保險):
    crsctl stop crs / crsctl start crs (逐節點)。
  2. 檢查叢集通訊:crsctl check cluster、olnodes -n。
  3. 驗證私網流量走新介面:netstat -i、tcpdump -i eth1、oradebug ipc。
  4. 更新 /etc/hosts、GPnP profile 中主機名解析 (如有變更)。

七、10g/11gR1 差異補充

# 10g/11gR1 寫入 OCR
$ oifcfg setif -global eth1/192.168.1.0:cluster_interconnect
$ oifcfg delif -global eth3/192.168.2.0
# 無需備份 GPnP XML,但需全叢集停機生效

八、風險控制清單

  • [ ] 新網卡已配置 IP、MTU 9000、交換機 VLAN 互通。
  • [ ] 兩節點 ping/ssh 新私網 IP 通暢。
  • [ ] 維護窗口內操作,業務知會。
  • [ ] 備份 GPnP Profile / OCR。
  • [ ] 回滾方案:oifcfg setif -global eth3/192.168.2.0:cluster_interconnect 恢復舊介面。

11gR2+ 私網遷移核心在於 oifcfg setif/delif -global 操作 GPnP Profile,**無需停叢集即可動態生效** (建議滾動重啟驗證),較 10g 手工編輯 OCR 時代大幅降低風險與停機時間。

copyright © 萬盛學電腦網 all rights reserved