CentOS 5中改造RAC的private ip实现双网卡绑定

本文详细介绍了如何在 CentOS 5.4 上安装的 Oracle 10g RAC 环境中将原有的单网卡心跳升级为双网卡绑定配置。通过具体的步骤展示了如何在不重启的情况下完成网卡绑定,并更改 RAC 的 Interconnect 接口名称。

CentOS 5.4上安装的10G RAC,原来的心跳是单网卡的,需要修改为双网卡。


原来的环境如下:
eth0 192.168.2.x public ip
eth1 192.168.0.x private ip


增加了一块网卡,接口名为eth2,需要将eth1与新增加的eth2实现绑定,并使用原来的IP。

修改过程主要涉及到两个问题:
1、实现双网卡绑定
2、修改RAC Interconnect interface name


实现过程如下:

[@more@]

1、实现CentOS5的双网卡绑定

在每个节点上以root用户身份进入/etc/sysconfig/network-scripts/目录,修改ifcfg-eth1、ifcfg-eth2文件,然后创建ifcfg-bond0文件,各个文件内容如下:

ifcfg-eth1

[root@rac2 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none



ifcfg-eth2
[root@rac2 network-scripts]# cat ifcfg-eth2
DEVICE=eth2
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none



ifcfg-bond0
需要注意的地方是,在CentOS5中,与CentOS4实现绑定的方式不同,需要将绑定参数(下面标记为绿色的一行)写入ifcfg-bond0文件中,而不是写入/etc/modprobe.conf文件中
[root@rac2 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
IPADDR=192.168.0.102
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
BONDING_OPTS="mode=0 miimon=100"


修改/etc/modprobe.conf文件,在文件最后增加一行,内容为"alias bond0 bonding",与CentOS4不同的是,这里不增加绑定参数的内容,因为绑定参数的内容已经配置在上面的ifcfg-bond0文件中配置了

[root@rac2 network-scripts]# cat /etc/modprobe.conf
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix
options snd-ens1371 index=0
remove snd-ens1371 { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-ens1371

options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
# Added by VMware Tools
install pciehp /sbin/modprobe -q --ignore-install acpiphp; /bin/true
install pcnet32 (/sbin/modprobe -q --ignore-install vmxnet || /sbin/modprobe -q --ignore-install pcnet32 $CMDLINE_OPTS);/bin/true
alias eth0 vmxnet
alias eth1 vmxnet
alias eth2 vmxnet

alias bond0 bonding


修改/etc/rc.d/rc.local文件,在文件中增加一行,内容为"ifenslave bond0 eth1 eth2"

[root@rac2 network-scripts]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

ifenslave bond0 eth1 eth2

chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chown oracle:oinstall /dev/raw/raw4
chown oracle:oinstall /dev/raw/raw5
chmod 600 /dev/raw/raw1
chmod 600 /dev/raw/raw2
chmod 600 /dev/raw/raw3
chmod 600 /dev/raw/raw4
chmod 600 /dev/raw/raw5

不需要重启主机,使用如下两个命令使绑定生效:

[root@rac2 network-scripts]# ldconfig

[root@rac2 ~]# /etc/init.d/network restart
Shutting down interface bond0: [ OK ]
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface bond0: [ OK ]
Bringing up interface eth0: [ OK ]

使用如下命令检查绑定情况

[root@rac2 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:a4:8a:8d

Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:a4:8a:97




2、修改RAC Interconnect interface name

修改Interconnect interface name或ip主要使用oifcfg命令,这个命令需要保持crs开启状态。
修改的操作只需要在一个节点上完成。

检查crs状态

[root@rac1 ~]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
[root@rac1 ~]#

检查CRS的public ip和private ip配置情况

[root@rac1 ~]# oifcfg getif
eth0 192.168.2.0 global public
eth1 192.168.0.0 global cluster_interconnect
[root@rac1 ~]#

这里要修改的是cluster_interconnect的接口名,由eth1修改为bond0
修改的过程很简单,首先删除,然后再设置

[root@rac1 ~]# oifcfg delif -global eth1
[root@rac1 ~]#
[root@rac1 ~]# oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
[root@rac1 ~]#

修改完成之后,检查修改是否生效

[root@rac1 ~]# oifcfg getif
eth0 192.168.2.0 global public
bond0 192.168.0.0 global cluster_interconnect
[root@rac1 ~]#
[root@rac1 ~]# oifcfg iflist
eth0 192.168.2.0
bond0 192.168.0.0
[root@rac1 ~]#

在两个节点上重启crs

[root@rac1 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac1 ~]# crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

[root@rac1 ~]# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@rac1 ~]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22049049/viewspace-1029339/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22049049/viewspace-1029339/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值