search
HomeDatabaseMysql Tutorial为RAC私有网络配置网卡Bonding

私有网络是RAC节点间通信的通道,包括节点间的网络心跳信息、Cache fusion传递数据块都需要通过私有网络。而很多的私有网络都仅仅

在RAC的安装部署过程中,并不仅仅是简单的安装完成了事,整个安装过程要考虑可能出现的单点问题,其中比较重要的是私有网络。

私有网络是RAC节点间通信的通道,包括节点间的网络心跳信息、Cache fusion传递数据块都需要通过私有网络。而很多的私有网络都仅仅是一块单独的网卡连接上交换机就完成了,更有甚者,直接使用服务器间网卡互连的方式配置私有网络。这种部署方式简单,但RAC投入使用后风险非常大,存在诸多单点如网卡、网线、交换机口、交换机。几乎每个组件发生故障都会导致RAC split,,所以建议为私有网络配置双网卡bonding。

Linux双网卡绑定实现负载均衡(Bonding双网卡绑定)

Linux Bonding的初始状态问题以及解决

多网卡绑定Bonding生产实战

多网卡负载均衡(双网卡做Bonding模式)

在CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

下面是我的配置步骤:

环境:

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.conf

alias bond0 bonding

[root@node2 ~]# modprobe -a bond0

验证:

[root@node2 ~]#  lsmod  |grep bond

bonding              127331  0

8021q                  25317  1 bonding

ipv6                  321422  274 bonding,ip6t_REJECT,nf_conntrack_ipv6,nf_defrag_ipv6

 

编辑网卡配置文件,编辑成如下内容:

节点一:

Ifcfg-em2:

DEVICE=em2

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

 

Ifcfg-em4:

DEVICE=em4

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

 

Ifcfg-bond0:

DEVICE=bond0

MASTER=yes

BOOTPROTO=node

ONBOOT=yes

BONDING_OPTS="mode=1 miimon=100"

IPADDR=10.10.10.105

PREFIX=24

GATEWAY=10.10.10.1

 

节点二:

ifcfg-em2:

DEVICE=em2

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

 

ifcfg-em4:

DEVICE=em4

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

 

Ifcfg-bond0:

DEVICE=bond0

MASTER=yes

BOOTPROTO=node

ONBOOT=yes

BONDING_OPTS="mode=1 miimon=100"

IPADDR=10.10.10.106

PREFIX=24

GATEWAY=10.10.10.1

我这里使用的是mode=1的主备网卡模式,平时只激活一块网卡,一旦主网卡发生故障,会切换链路到备网卡,其他也可以考虑4,6两种mode。

修改完了配置文件之后,分别在2个节点启动bond0:ifup bond0。

此时可以看到:

[root@node1 ~]# ifconfig

bond0    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]# ls

pending.xml  profile_orig.xml  profile.xml  profile.xml.bk、

查看目前的私有网络配置:

node2-> oifcfg getif

em1  192.168.10.0  global  public

em3  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_interconnect

PRIF-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 gpnp

grid      4927    1  0 Sep22 ?        00:26:38 /u01/app/11.2.0/grid/bin/gpnpd.bin

grid    48568 46762  0 17:26 pts/3    00:00:00 tail -f /u01/app/11.2.0/grid/log/node2/gpnpd/gpnpd.log

root    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个节点分别执行以下命令:

停止crs

crsctl stop crs

禁用crs

crsctl disable crs

 

 

修改hosts文件,将私有IP地址改为新地址。

2个节点分别执行:

 ping node1-priv

 ping node2-priv

 

 再启动crs。

 [root@node2 ~]# crsctl enable crs

CRS-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 getif

em1  192.168.10.0  global  public

bond0  10.10.10.0  global  cluster_interconnect

node2->

更多详情见请继续阅读下一页的精彩内容:

linux

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to Grant Permissions to New MySQL UsersHow to Grant Permissions to New MySQL UsersMay 09, 2025 am 12:16 AM

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

How to Add Users in MySQL: A Step-by-Step GuideHow to Add Users in MySQL: A Step-by-Step GuideMay 09, 2025 am 12:14 AM

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

MySQL: Adding a new user with complex permissionsMySQL: Adding a new user with complex permissionsMay 09, 2025 am 12:09 AM

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

MySQL: String Data Types and CollationsMySQL: String Data Types and CollationsMay 09, 2025 am 12:08 AM

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

MySQL: What length should I use for VARCHARs?MySQL: What length should I use for VARCHARs?May 09, 2025 am 12:06 AM

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

MySQL BLOB : are there any limits?MySQL BLOB : are there any limits?May 08, 2025 am 12:22 AM

MySQLBLOBshavelimits:TINYBLOB(255bytes),BLOB(65,535bytes),MEDIUMBLOB(16,777,215bytes),andLONGBLOB(4,294,967,295bytes).TouseBLOBseffectively:1)ConsiderperformanceimpactsandstorelargeBLOBsexternally;2)Managebackupsandreplicationcarefully;3)Usepathsinst

MySQL : What are the best tools to automate users creation?MySQL : What are the best tools to automate users creation?May 08, 2025 am 12:22 AM

The best tools and technologies for automating the creation of users in MySQL include: 1. MySQLWorkbench, suitable for small to medium-sized environments, easy to use but high resource consumption; 2. Ansible, suitable for multi-server environments, simple but steep learning curve; 3. Custom Python scripts, flexible but need to ensure script security; 4. Puppet and Chef, suitable for large-scale environments, complex but scalable. Scale, learning curve and integration needs should be considered when choosing.

MySQL: Can I search inside a blob?MySQL: Can I search inside a blob?May 08, 2025 am 12:20 AM

Yes,youcansearchinsideaBLOBinMySQLusingspecifictechniques.1)ConverttheBLOBtoaUTF-8stringwithCONVERTfunctionandsearchusingLIKE.2)ForcompressedBLOBs,useUNCOMPRESSbeforeconversion.3)Considerperformanceimpactsanddataencoding.4)Forcomplexdata,externalproc

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool