Welcome 微信登录

首页 / 数据库 / MySQL / 为RAC私有网络配置网卡Bonding

在RAC的安装部署过程中,并不仅仅是简单的安装完成了事,整个安装过程要考虑可能出现的单点问题,其中比较重要的是私有网络。私有网络是RAC节点间通信的通道,包括节点间的网络心跳信息、Cache fusion传递数据块都需要通过私有网络。而很多的私有网络都仅仅是一块单独的网卡连接上交换机就完成了,更有甚者,直接使用服务器间网卡互连的方式配置私有网络。这种部署方式简单,但RAC投入使用后风险非常大,存在诸多单点如网卡、网线、交换机口、交换机。几乎每个组件发生故障都会导致RAC split,所以建议为私有网络配置双网卡bonding。Linux双网卡绑定实现负载均衡(Bonding双网卡绑定) http://www.linuxidc.com/Linux/2014-01/94771.htmLinux Bonding的初始状态问题以及解决 http://www.linuxidc.com/Linux/2013-01/77708.htm多网卡绑定Bonding生产实战 http://www.linuxidc.com/Linux/2012-10/72719.htm多网卡负载均衡(双网卡做Bonding模式) http://www.linuxidc.com/Linux/2012-09/70293.htm在CentOS 6.4下安装Oracle 11gR2(x64) http://www.linuxidc.com/Linux/2014-02/97374.htmOracle 11gR2 在VMWare虚拟机中安装步骤 http://www.linuxidc.com/Linux/2013-09/89579p2.htmDebian 下 安装 Oracle 11g XE R2 http://www.linuxidc.com/Linux/2014-03/98881.htm下面是我的配置步骤:环境:OS:CentOS release 6.4 (Final)Oracle:11.2.0.4 RAC网卡:4个 em1,em2,em3,em4,当前em1作为公有网卡,em3作为私有网卡已经启用了,em2和em4闲置。配置bond模块并加载(在2个节点执行):编辑/etc/modprobe.d/bonding.conf加入内容: [root@node2 ~]# vi /etc/modprobe.d/bonding.confalias bond0 bonding[root@node2 ~]# modprobe -a bond0验证:[root@node2 ~]#  lsmod  |grep bondbonding              127331  08021q                  25317  1 bondingipv6                  321422  274 bonding,ip6t_REJECT,nf_conntrack_ipv6,nf_defrag_ipv6 编辑网卡配置文件,编辑成如下内容:节点一:Ifcfg-em2:DEVICE=em2BOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yes Ifcfg-em4:DEVICE=em4BOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yes Ifcfg-bond0:DEVICE=bond0MASTER=yesBOOTPROTO=nodeONBOOT=yesBONDING_OPTS="mode=1 miimon=100"IPADDR=10.10.10.105PREFIX=24GATEWAY=10.10.10.1 节点二:ifcfg-em2:DEVICE=em2BOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yes ifcfg-em4:DEVICE=em4BOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yes Ifcfg-bond0:DEVICE=bond0MASTER=yesBOOTPROTO=nodeONBOOT=yesBONDING_OPTS="mode=1 miimon=100"IPADDR=10.10.10.106PREFIX=24GATEWAY=10.10.10.1我这里使用的是mode=1的主备网卡模式,平时只激活一块网卡,一旦主网卡发生故障,会切换链路到备网卡,其他也可以考虑4,6两种mode。修改完了配置文件之后,分别在2个节点启动bond0:ifup bond0。此时可以看到:[root@node1 ~]# ifconfigbond0    Link encap:Ethernet  HWaddr C8:1F:66:FB:6F:CB           inet addr:10.10.10.105  Bcast:10.10.10.255  Mask:255.255.255.0          inet6 addr: fe80::ca1f:66ff:fefb:6fcb/64 Scope:Link          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1          RX packets:9844809 errors:0 dropped:0 overruns:0 frame:0          TX packets:7731078 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0          RX bytes:9097132073 (8.4 GiB)  TX bytes:6133004979 (5.7 GiB)em2      Link encap:Ethernet  HWaddr C8:1F:66:FB:6F:CB           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1          RX packets:9792915 errors:0 dropped:0 overruns:0 frame:0          TX packets:7731078 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:9088278883 (8.4 GiB)  TX bytes:6133004979 (5.7 GiB)          Interrupt:38 em4      Link encap:Ethernet  HWaddr C8:1F:66:FB:6F:CB           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1          RX packets:51894 errors:0 dropped:0 overruns:0 frame:0          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:8853190 (8.4 MiB)  TX bytes:0 (0.0 b)          Interrupt:36网卡的bonding已经配置成功了。测试验证此时可以测试分别断掉em2 em4,在一个节点长ping另一个节点的私有IP,并结合/proc/net/bonding/bond0的信息观察primary slave的变化,可以发现当down一个网卡时ping不会中断。Bond0配置好之后,接下来一步就是把配置成RAC的私有网卡。为了避免配置失败,首先要备份好原来的配置文件。以grid用户在2个节点对$GRID_HOME/ grid/gpnp/noden/profiles/peer/profile.xml文件执行备份: cd /u01/app/11.2.0/grid/gpnp/noden/profiles/peer cp  profile.xml  profile.xml.bk[root@node2 peer]# lspending.xml  profile_orig.xml  profile.xml  profile.xml.bk、查看目前的私有网络配置:node2-> oifcfg getifem1  192.168.10.0  global  publicem3  10.10.10.0  global  cluster_interconnect先添加新的私有网络,在任一节点执行即可:node1-> oifcfg setif -global bond0/10.10.10.0:cluster_interconnect这一步在执行时可能会报错:node1-> oifcfg setif -global bond0/10.10.10.0:cluster_interconnectPRIF-33: Failed to set or delete interface because hosts could not be discovered  CRS-02307: No GPnP services on requested remote hosts.PRIF-32: Error in checking for profile availability for host node2  CRS-02306: GPnP service on host "node2" not found. 这是因为gpnpd服务异常导致的。解决方法:可以Kill掉gpnpd进程,GI会自动重新启动gpnpd服务。在2个节点执行:[root@node2 ~]# ps -ef| grep gpnpgrid      4927    1  0 Sep22 ?        00:26:38 /u01/app/11.2.0/grid/bin/gpnpd.bingrid    48568 46762  0 17:26 pts/3    00:00:00 tail -f /u01/app/11.2.0/grid/log/node2/gpnpd/gpnpd.logroot    48648 48623  0 17:26 pts/4    00:00:00 grep gpnp[root@node2 ~]# kill -9 4927[root@node2 ~]#参考gpnpd.log添加私有网络之后,我们按照如下步骤将原来的私有网络删除:首先停止并disable掉crs。以root用户在2个节点分别执行以下命令:停止crscrsctl stop crs禁用crscrsctl disable crs  修改hosts文件,将私有IP地址改为新地址。2个节点分别执行: ping node1-priv ping node2-priv  再启动crs。 [root@node2 ~]# crsctl enable crsCRS-4622: Oracle High Availability Services autostart is enabled.[root@node2 ~]# crsctl start crs删除原来的私有网络:node2-> oifcfg delif -global em3/10.10.10.0:cluster_interconnect检查验证,配置成功了。node2-> oifcfg getifem1  192.168.10.0  global  publicbond0  10.10.10.0  global  cluster_interconnectnode2->更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-10/108463p2.htm
  • 1
  • 2
  • 下一页
Oracle会话及连接数优化MySQL子查询慢现象的解决相关资讯      bonding  rac 
  • RAC本地数据文件迁移至ASM的方法--  (05月23日)
  • 浅谈RAC中的负载均衡  (09/06/2015 21:49:33)
  • Oracle 11gR2 RAC实时应用集群  (01/05/2015 09:17:03)
  • RAC之间消息传输流量控制  (12/26/2015 15:52:38)
  • Oracle 11.2.0.4 RAC日志记录的时  (01/29/2015 08:46:34)
  • 基于Workstation8、CentOS6.5实现  (01/04/2015 15:42:35)
本文评论 查看全部评论 (0)
表情: 姓名: 字数