Linux+Oracle 10g RAC雙網卡綁定和解除綁定

來源:互聯網
上載者:User

一、軟硬體環境概述

在虛擬機器VMware GSX Server上安裝兩套redhet Enterprise-R4-U4系統rac1和rac2,虛擬共用儲存, 在此基礎上搭建的Oracle10g RAC環境。

1、  rac1兩塊網卡eth0:192.168.2.111,eth1:10.10.10.11

2、  rac2兩塊網卡eth0:192.168.2.112,eth1:10.10.10.12

/etc/hosts檔案:

127.0.0.1

localhost

 

192.168.2.111

rac1.mycorpdomain.com

rac1

192.168.2.13

rac1-vip.mycorpdomain.com

rac1-vip

10.10.10.11

rac1-priv.mycorpdomain.com

rac1-priv

192.168.2.112

rac2.mycorpdomain.com

rac2

192.168.2.14

rac2-vip.mycorpdomain.com

rac2-vip

10.10.10.12

rac2-priv.mycorpdomain.com

rac2-priv

 

二、添加網卡eth2

1、  在rac1和rac2上分別以host-only的模式添加一塊網卡

a、  Edit virtual machine

b、  Add進入add hardware wizard,下一步

c、  選擇ethernet adapter 下一步

d、  選擇host-only,完成

2、啟動虛擬機器,此時ifconfig –a可以看見多出了一個網卡eth2,只是沒有IP地址,在network configuration圖形介面的hardware選項頁可以看見eth2,status為OK。

三、在rac1和rac2上停資料庫和crs

#cd  /u01/app/oracle/product/10.2.0/crs_1/bin

停資料庫執行個體

#./srvctl stop instance –d devdb –i ora.devdb.devd1.inst

#./srvctl stop instance –d devdb –i ora.devdb.devd2.inst

停資料庫

#./srvctl stop database –d devdb

停ASM執行個體

#./srvctl stop asm –n rac1

#./srvctl stop asm –n rac2

停vip,gsd,listener,ons

#./srvctl stop nodeapps –n rac1

#./srvctl stop nodeapps –n rac2

四、更改網卡配置綁定網卡

更改eth0和eth2的設定檔,將eth0和eth2綁定為一塊虛擬網卡bond0.

1、   首先在/etc/sysconfig/network-scripts/下建立虛擬網卡bond0的設定檔ifcfg-bond0

#cd /etc/sysconfig/network-scripts/

#vi ifcfg-bond0

DEVICE=bond0

BOOTPROTO=none

BROADCAST=192.168.2。255

IPADDR=192.168.2.111

NETMASK=255.255.255.0

NETWORK=192.168.2.0

ONBOOT=yes

TYPE=Ethernet

USERCTL=no

PEERDNS=yes

GATEWAY=192.168.168.250

IPV6INIt=no

2、   更改eth0的設定檔ifcfg-eth0,更改後的內容如下

Vi ifcfg-eth0

DEVICE=eth0

BOOTPROTO=none

ONBOOT=yes

TYPE=Ethernet

USERCTL=no

MASTER=bond0

SLAVE=yes

3、   添加eth2的設定檔ifcfg-eth2

Vi ifcfg-eth2

DEVICE=eth2

BOOTPROTO=none

ONBOOT=yes

TYPE=Ethernet

USERCTL=no

MASTER=bond0

SLAVE=yes

4、   因為linux的虛擬網卡是在核心模組中實現的,所以需要安裝的時候已經裝好該module。在/etc/modules.conf檔案中添加如下內容(如果沒有該檔案,則建立一個):

alias bond0 bonding

options bond0 miimon=100 mode=0 primary=eth0

其中miimon=100表示每100ms檢查一次鏈路串連狀態,如果不通則會切換物理網卡,mode=1表示主備模式,也就是只有一塊網卡是active的,只提供失效保護。如果mode=0則是負載平衡模式的,所有的網卡都是active,還有其他一些模式很少用到,primary=eth0表示主備模式下eth0為預設的active網卡

5、   在/etc/rc.local中加入modprobe bonding miimon=100 mode=0

6、   在rac2上也進行同樣的修改

7、   重啟後生效,ifconfig -a查看可以發現多了bond0這個網卡,配置了原來eth0的ip配置,在network configuration的圖形介面可以發現也多了bond0

  • 1
  • 2
  • 3
  • 下一頁

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.