为Oracle Clusterware修改公用及私有网络接口

出于种种原因我们可能需要为已安装的Oracle集群软件修改其使用的公用或私有网络所使用的网络接口(How to Change Interconnect/Public Interface IP or Subnet in Oracle Clusterware),这些共有或私有网络(public/private network)被保存在ocr中,我们需要以root用户的身份执行oifcfg命令来对这些网络接口信息进行修改:

/* 使用ocrdump命令转储ocr信息 */

[oracle@vrh1 ~]$ ocrdump ocr

[oracle@vrh1 ~]$ cat ocr

[SYSTEM.css.interfaces]UNDEF 
[SYSTEM.css.interfaces.global]UNDEF 
[SYSTEM.css.interfaces.global.eth0]UNDEF 
[SYSTEM.css.interfaces.global.eth0.131|d32|d1|d0]UNDEF 
[SYSTEM.css.interfaces.global.eth0.131|d32|d1|d0]ORATEXT : public

[SYSTEM.css.interfaces.global.eth1]UNDEF
[SYSTEM.css.interfaces.global.eth1.131|d33|d1|d0]UNDEF :
[SYSTEM.css.interfaces.global.eth1.131|d33|d1|d0]ORATEXT : cluster_interconnect

.............

/* 实际上css的misscount参数和voting disk所在的位置也存在ocr文件中  */

[SYSTEM.css.misscount]UB4 (10) : 60
[SYSTEM.css.diskfile]ORATEXT : /dev/raw/raw2

1.首先我们可以通过oifcfg getif了解当前的public/interconnect网络配置情况:

[root@vrh1 ~]# who am i
root     pts/1        2011-04-18 18:23 (192.168.0.1)

[root@vrh1 ~]# cd $ORA_CRS_HOME/bin

[root@vrh1 bin]# oifcfg getif
eth0  131.32.1.0  global  public
eth1  131.33.1.0  global  cluster_interconnect

/* 可以看到这里分别用131.32.1/2网段配置了public和cluster_interconnect网络  */

2.确认在/etc/hosts文件中为新的网络接口IP做了必要的修改,之后我们要保证当前CRS已经启动(否则将出现PRIF-10: failed to initialize the cluster registry错误而无法配置),使用oifcfg setif命令首先添加新的public公用网络接口:

[root@vrh1 bin]# oifcfg delif -global eth0

/* 首先删除旧有的公用网络接口信息  */

[root@vrh1 bin]# oifcfg setif -global eth0/192.168.1.0:public

/* 注意这里制定192.168.1.0这个网段即可,不用输入完整的ip */

/* 因为以上操作是global全局操作,在单个节点完成即可 */

3.修改内联网络(cluster_interconnect)接口的方法也是类似的:

[root@vrh1 bin]# oifcfg delif -global eth1

[root@vrh1 bin]# oifcfg setif -global eth1/192.168.0.0:cluster_interconnect

/* 与public network配置时类似指定网段即可  */

4.确认网络接口的修改情况,以及当前数据库使用的inter connecter状况:

[oracle@vrh1 ~]$ oifcfg getif
eth0  192.168.1.0  global  public
eth1  192.168.0.0  global  cluster_interconnect

SQL> select * from x$skgxpia;

ADDR           INDX    INST_ID PUB_SKGXPI PICKED_SKGXPIA
-------- ---------- ---------- ---------- -----------------------------------
NAME_SKGXPIA    IP_SKGXPIA
--------------- ----------------
4572EC54          0          1 N          OSD
eth1            131.33.1.107

/* 可以看到当前数据库实例仍使用旧有的inter connect网络 */

[root@vrh1 ~]# crsctl stop crs

[root@vrh1 ~]# crsctl start crs

[oracle@vrh1 ~]$ sqlplus / as sysdba

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> 
SQL> select * from x$skgxpia;

ADDR           INDX    INST_ID PUB_SKGXPI PICKED_SKGXPIA
-------- ---------- ---------- ---------- -----------------------------------
NAME_SKGXPIA    IP_SKGXPIA
--------------- ----------------
4572EC54          0          1 N          OSD
eth1            192.168.0.107

/* 这里需要重启CRS后实例才能正确使用更新后的cluster interconnect网络接口 */

Comments

  1. 请问你一下,这个是不是适合oracle11gr2下的,对10gR2 可以有用吗?

    • admin says

      适用于10GR2,经过测试验证
      对于11GR2没有具体测试过,当应该也可以,我最近会测试一下,谢谢提出问题!

  2. 我觉得这篇文章还不完整,博主没有写如何修改 VIP 的 IP。在修改了 public NIC 和 private NIC 的情况下,VIP 的修改是必须的,不然整个 Clusterware 是不能正常工作的。

    • admin says

      是不完整,后续的vip可以通过vipca来配置,一般不会有太大的问题,谢谢指出。

  3. Cluster Interconnect (Cont’)

    Clusterware and Database (GCS/DLM/PQ) communications on same underlying transport (NIC)

    These could be split if the need arises
    Might be needed with many databases on the same cluster
    Clusterware uses: olsnodes -p
    DB uses: oifcfg getif (cluster_interconnect)
    DB may override Clusterware via the cluster_interconnects init.ora on a per database basis

    select * from v$cluster_interconnects;
    VIP uses: oifcfg getif (public)

    Private NICs and public NICs should be kept the same name/order on all cluster members

  4. Pre-Migration Considerations Ensure Infiniband is used for Clusterware and RAC

    Infiniband is pre-configured on the Exadata Storage Servers and the Database Machine compute nodes
    If not using Database Machine
    Ensure private network used for Clusterware communication is using the Infiniband Network
    oifcfg getif –type cluster_interconnect
    Ensure private network used for RAC communication is running RDS over Inifiniband
    Alert log displays the ‘Oracle RDS/IP’ for cluster interconnect

    If not running RDS, relink oracle
    make –f ins_rdb,s.mk ipc_rds ioracle

  5. OIFCFG/VIPCA

    Oracle interface configuration tool.
    Lists interfaces associated with subnets (oifcfg_ifls).
    Sets interconnect details in OCR for SKGXP.
    Marks public interfaces – VIP, OracleNet.
    Marks cluster_interconnect – CRS, CSS, SKGXP.
    oifcfg_ifls used by installer, not shipped.

    Before 10.1, cluster_interconnect variable in init.ora was used to specify private
    Interfaces.
    Interface Name Subnet Inteface type
    CorpLan 144.25.214.0 Public/cluster_interconnect
    Priv10.10.10.5 10.10.8.0 Public/cluster_interconnect

    oifcfg ifls
    oifcfg getif [ -node ] [ -global ]
    oifcfg setif [ -node ] [-global ]
    oifcfg delif [ -node ] [ -global ]

    OIFCFG – OCR
    Key system.css.interfaces in ocr (OCRCONFIG )
    Node specific interface details
    system.css.interfaces.node…
    Global interface details
    system.css.interfaces.global….
    KSXP reads OCR and hands these to SKGXP [ for inter instance comm ]

Trackbacks

  1. […] 11g新特性:Streams同步捕获 Convert your single instance to 10g RAC by manual 为Oracle Clusterware修改公用及私有网络接口 Discover Your Missed ASM Disks GoldenGate实现Live Standby主备库切换 再议RAC Brain […]

Comment

*

沪ICP备14014813号-2

沪公网安备 31010802001379号