Oracle 11gR2 RAC 单网卡转双网卡绑定配置

来源:这里教程网 时间:2026-03-03 18:20:20 作者:

一 说明

11g RAC 搭建完成之后,需将单网卡转双网卡绑定。需将 public ip private ip 都转成双网卡。其中, eth0 eth1 绑定成业务地址, eth2 eth3 绑定成心跳地址。

 

二 数据库备份

urpdb

export ORACLE_SID=urpdb2             

expdp \'/ as sysdba\' directory=dmp dumpfile=urpdb2019.dmp  logfile=urpdb2019.log full=y 

 

ip

export ORACLE_SID=IP2

expdp \'/ as sysdba\' directory=dmp dumpfile=ip2019.dmp  logfile=ip2019.log full=y

 

三 前期环境确认

3.1  RAC IP 信息

[sussysadmin@server108 ~]# more /etc/hosts

10.10.200.7  server107           

10.10.200.8  server108

 

10.10.200.41   server107-vip

10.10.200.42   server108-vip

 

192.168.200.120        server107-priv     

192.168.200.121        server108-priv

 

10.10.200.121  server-scan

 

目前两个节点的 eth0  对应 Public IP eth3  对应 Private IP ,目标是 eth0  eht1  绑定 bond0 对应 Public IP eth2  eth3  绑定 bond1 对应 Private IP, 具体 IP 地址不变。

 

3.2  当前 public private 信息

[grid@server108 ~]$ oifcfg getif -global

eth0  10.10.200.0  global  public

eth3  192.168.200.0  global  cluster_interconnect

 

[grid@server108 ~]$ srvctl config nodeapps

Network exists: 1/10.10.200.0/255.255.255.0/eth0, type static

VIP exists: /server107-vip/10.10.200.41/10.10.200.0/255.255.255.0/eth0, hosting node server107

VIP exists: /server108-vip/10.10.200.42/10.10.200.0/255.255.255.0/eth0, hosting node server108

GSD exists

ONS exists: Local port 6100, remote port 6200, EM port 2016

 

[grid@server108 ~]$ srvctl config nodeapps -n server108 -a

-n <node_name> option has been deprecated.

Network exists: 1/10.10.200.0/255.255.255.0/eth0, type static

VIP exists: /server108-vip/10.10.200.42/10.10.200.0/255.255.255.0/eth0, hosting node server108

 

[grid@server108 ~]$ srvctl config nodeapps -n server107 -a

-n <node_name> option has been deprecated.

Network exists: 1/10.10.200.0/255.255.255.0/eth0, type static

VIP exists: /server107-vip/10.10.200.41/10.10.200.0/255.255.255.0/eth0, hosting node server107

 

四 修改 RAC 配置

4.1  修改 public private 信息

[root@server107 bin]# ./oifcfg delif -global eth0 

[root@server107 bin]# ./oifcfg delif -global eth3 

PRIF-31: Failed to delete the specified network interface because it is the last private interface

目前无法删除 private 信息,需要先添加再删除

[root@server107 bin]# ./oifcfg setif -global bond0/10.10.200.0:public

[root@server107 bin]# ./oifcfg setif -global bond1/192.168.200.0:cluster_interconnect

 

[root@server107 bin]# ./oifcfg delif -global eth3

[root@server107 bin]# ./oifcfg getif

bond0  10.10.200.0  global  public

bond1  192.168.200.0  global  cluster_interconnect

 

五 双网卡绑定配置

5.1  停止 rac (确保两个节点都停掉)

[root@server107 bin]# ./crsctl stop crs

[root@server108 bin]# ./crsctl stop crs  或者( ./crsctl stop crs -f

 

5.2 SERVER107 操作:

备份原来的文件:

[root@server107 network-scripts]# mv ifcfg-eth0 ifcfg-eth0.bak

[root@server107 network-scripts]# mv ifcfg-eth3 ifcfg-eth3.bak

 

5.2.1  修改网卡配置文件

创建 bond0 配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

BOOTPROTO=none

IPADDR= 10.10.200.7

NETMASK=255.255.255.0

>

TYPE=Ethernet

GATEWAY= 10.10.200.251

USERCTL=no

IPV6INIT=no

PEERDNS=yes

 

创建 bond1 配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-bond1

DEVICE=bond1

BOOTPROTO=none

IPADDR= 192.168.200.120

NETMASK= 255.255.255.0

>

TYPE=Ethernet

USERCTL=no

IPV6INIT=no

PEERDNS=yes

 

 

修改 eth0

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond0

SLAVE=yes

 

修改 eth1

vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond0

SLAVE=yes

 

修改 eth2

vi /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond1

SLAVE=yes

 

修改 eth3

vi /etc/sysconfig/network-scripts/ifcfg-eth3

DEVICE=eth3

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond1

SLAVE=yes

 

5.2.2  绑定配置模型

vi /etc/modprobe.d/dist.conf

alias bond0 bonding

options bond0 miimon=100 mode=0

 

alias bond1 bonding

options bond1 miimon=100 mode=0

 

5.2.3  配置网卡启动顺序

[root@server107 network-scripts]# vi /etc/rc.d/rc.local

ifenslave bond0 eth0 eth1

ifenslave bond1 eth2 eth3

 

5.2.4  关闭 NetworkManager 服务

[root@SERVER107 ~]# service NetworkManager stop

[root@SERVER107 ~]# chkconfig NetworkManager off

 

5.2.5  重启网络服务

[root@SERVER107 ~]# chkconfig NetworkManager off

[root@SERVER107 ~]# service network restart

正在关闭接口  bond0  [ 确定 ]

正在关闭接口  bond1  [ 确定 ]

关闭环回接口:  [ 确定 ]

弹出环回接口:  [ 确定 ]

弹出界面  bond0  Determining if ip address 10.5.10.2 is already in use for device bond0...

[ 确定 ]

弹出界面  bond1  Determining if ip address 8.8.8.1 is already in use for device bond1...

[ 确定 ]

 

至此, SERVER107 的网卡绑定操作完成

 

5.3 SERVER108 操作:

备份原来的文件

[root@server108 network-scripts]# mv ifcfg-eth0 ifcfg-eth0.bak

[root@server108 network-scripts]# mv ifcfg-eth3 ifcfg-eth3.bak

 

5.3.1  修改网卡配置文件

创建 bond0 配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

BOOTPROTO=none

IPADDR= 10.10.200.8

NETMASK=255.255.255.0

>

TYPE=Ethernet

GATEWAY= 10.10.200.251

USERCTL=no

IPV6INIT=no

PEERDNS=yes

 

创建 bond1 配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-bond1

DEVICE=bond1

BOOTPROTO=none

IPADDR=192.168.200.121

NETMASK=255.255.255.0

>

TYPE=Ethernet

USERCTL=no

IPV6INIT=no

PEERDNS=yes

 

修改 eth0

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond0

SLAVE=yes

 

修改 eth1

vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond0

SLAVE=yes

 

修改 eth2

vi /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond1

SLAVE=yes

 

修改 eth3

vi /etc/sysconfig/network-scripts/ifcfg-eth3

DEVICE=eth3

TYPE=Ethernet

>

NM_CONTROLLED=yes

BOOTPROTO=none

IPV6INIT=no

USERCTL=no

PEERDNS=yes

MASTER=bond1

SLAVE=yes

 

 

5.3.2  绑定配置模型

vi /etc/modprobe.d/dist.conf

alias bond0 bonding

options bond0 miimon=100 mode=0

 

alias bond1 bonding

options bond1 miimon=100 mode=0

 

5.2.3  配置网卡启动顺序

[root@server108 network-scripts]# vi /etc/rc.d/rc.local

ifenslave bond0 eth0 eth1

ifenslave bond1 eth2 eth3

 

5.2.4  关闭 NetworkManager 服务

[root@SERVER108 ~]# service NetworkManager stop

[root@SERVER108 ~]# chkconfig NetworkManager off

 

5.2.5  重启网络服务

[root@SERVER108 ~]# chkconfig NetworkManager off

[root@SERVER108 ~]# service network restart

正在关闭接口  bond0  [ 确定 ]

正在关闭接口  bond1  [ 确定 ]

关闭环回接口:  [ 确定 ]

弹出环回接口:  [ 确定 ]

弹出界面  bond0  Determining if ip address 10.5.10.2 is already in use for device bond0...

[ 确定 ]

弹出界面  bond1  Determining if ip address 8.8.8.1 is already in use for device bond1...

[ 确定 ]

 

至此, SERVER108 的网卡绑定操作完成

 

 

六 重启 SERVER107 SERVER108 服务器

一二节点 root 用户 Reboot 

七 修改 vip

[root@server107 bin]# ./srvctl modify nodeapps -n server107 -A 10.10.200.41/255.255.255.0/bond0

[root@server107 bin]# ./srvctl modify nodeapps -n server108 -A 10.10.200.42/255.255.255.0/bond0

 

再次检查集群状态,发现已经正常。如若不正常,手工重启部分服务,至此,单网卡转双网卡绑定成功,应用测试。

 

八 回退方案

8.1  确认 public private 信息

 [root@server107 bin]#  ./oifcfg getif 

bond0  10.10.200.0  global  public

bond1  192.168.200.0  global  cluster_interconnect

 

8.2  修改 public private 信息

[root@server107 bin]# ./oifcfg delif -global bond0

[root@server107 bin]# ./oifcfg delif -global bond1

PRIF-31: Failed to delete the specified network interface because it is the last private interface

 

[root@server107 bin]# ./oifcfg setif -global eth0/10.10.200.0:public

[root@server107 bin]# ./oifcfg setif -global eth3/ 192.168.200.0:cluster_interconnect

 

[root@server107 bin]# ./oifcfg delif -global bond1

[root@server107 bin]# ./oifcfg getif

eth0  10.10.200.0  global  public

eth3  192.168.200.0  global  cluster_interconnect

 

8.3  还原网卡绑定

一节点:

[root@server107 network-scripts]# mv ifcfg-bond0 ifcfg-bond0.bak

[root@server107 network-scripts]# mv ifcfg-bond1 ifcfg-bond1.bak

[root@server107 network-scripts]# mv ifcfg-eth0 ifcfg-eth0.bakbak

[root@server107 network-scripts]# mv ifcfg-eth1 ifcfg-eth1.bakbak

[root@server107 network-scripts]# mv ifcfg-eth2 ifcfg-eth2.bakbak

[root@server107 network-scripts]# mv ifcfg-eth3 ifcfg-eth3.bakbak

 

[root@server107 network-scripts]# mv ifcfg-eth0.bak ifcfg-eth0

[root@server107 network-scripts]# mv ifcfg-eth3.bak ifcfg-eth3

 

vi /etc/modprobe.d/dist.conf

#alias bond0 bonding

#options bond0 miimon=100 mode=0

 

#alias bond1 bonding

#options bond1 miimon=100 mode=0

 

vi /etc/rc.d/rc.local

#ifenslave bond0 eth0 eth1

#ifenslave bond1 eth2 eth3

 

 

二节点:

[root@server108 network-scripts]# mv ifcfg-bond0 ifcfg-bond0.bak

[root@server108 network-scripts]# mv ifcfg-bond1 ifcfg-bond1.bak

[root@server108 network-scripts]# mv ifcfg-eth0 ifcfg-eth0.bakbak

[root@server108 network-scripts]# mv ifcfg-eth1 ifcfg-eth1.bakbak

[root@server108 network-scripts]# mv ifcfg-eth2 ifcfg-eth2.bakbak

[root@server108 network-scripts]# mv ifcfg-eth3 ifcfg-eth3.bakbak

         

[root@server108 network-scripts]# mv ifcfg-eth0.bak ifcfg-eth0

[root@server108 network-scripts]# mv ifcfg-eth3.bak ifcfg-eth3

 

vi /etc/modprobe.d/dist.conf

#alias bond0 bonding

#options bond0 miimon=100 mode=0

 

#alias bond1 bonding

#options bond1 miimon=100 mode=0

 

vi /etc/rc.d/rc.local

#ifenslave bond0 eth0 eth1

#ifenslave bond1 eth2 eth3

 

8.4  修改 vip

[root@server107 bin]# ./srvctl modify nodeapps -n server107 -A 10.10.200.41/255.255.255.0/eth0

[root@server107 bin]# ./srvctl modify nodeapps -n server108 -A 10.10.200.42/255.255.255.0/eth0

 

再次检查集群状态,发现均已正常

相关推荐