Linux + Oracle 10g RAC dual Nic binding and unbinding implementation (1)

Source: Internet
Author: User

This article mainly introduces the implementationOracle 10gDatabaseRACFunctionalBind two NICsWith the implementation method of Unbinding, let's take a look at this process.

I. Overview of software and hardware Environments

Two redhet Enterprise-R4-U4 systems rac1 and rac2 are installed on the Virtual Machine VMware GSX Server, and the oracle10g RAC environment is built on the virtual shared storage.

1. rac1 two NICs: eth0: 192.168.2.111, eth1: 10.10.10.11.

2. rac2 two NICs: eth0: 192.168.2.112 and eth1: 10.10.10.12.

/Etc/hosts file:

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

2. Add the network adapter eth2

1. Add a NIC in host-only mode on rac1 and rac2 respectively.

A. Edit virtual machine

B. Add to add hardware wizard. Next Step

C. Select ethernet adapter.

D. Select host-only.

2. Start the VM. At this time, ifconfig-a can see an extra Nic eth2, but there is no IP address. On the hardware option page of the network configuration graphic interface, you can see eth2 and the status is OK.

3. Stopping databases and crs on rac1 and rac2

 
 
  1. # Cd/u01/app/oracle/product/10.2.0/crs_1/bin
  2.  
  3. Stop a database instance
  4.  
  5. #./Srvctl stop instance-d devdb-I ora. devdb. devd1.inst
  6.  
  7. #./Srvctl stop instance-d devdb-I ora. devdb. devd2.inst
  8.  
  9. Stop Database
  10.  
  11. #./Srvctl stop database-d devdb
  12.  
  13. Stop an ASM instance
  14.  
  15. #./Srvctl stop asm-n rac1
  16.  
  17. #./Srvctl stop asm-n rac2
  18.  
  19. Stop vip, gsd, listener, ons
  20.  
  21. #./Srvctl stop nodeapps-n rac1
  22.  
  23. #./Srvctl stop nodeapps-n rac2

4. Change Nic configuration and bind Nic

Change the configuration files of eth0 and eth2, and bind eth0 and eth2 to a virtual network card bond0.

1. First create a virtual Nic bond0 configuration file ifcfg-bond0 under/etc/sysconfig/network-scripts/

 
 
  1. #cd /etc/sysconfig/network-scripts/  
  2.  
  3. #vi ifcfg-bond0  
  4.  
  5. DEVICE=bond0 
  6.  
  7. BOOTPROTO=none 
  8.  
  9. BROADCAST=192.168.2。255  
  10.  
  11. IPADDR=192.168.2.111  
  12.  
  13. NETMASK=255.255.255.0  
  14.  
  15. NETWORK=192.168.2.0  
  16.  
  17. ONBOOT=yes 
  18.  
  19. TYPE=Ethernet 
  20.  
  21. USERCTL=no 
  22.  
  23. PEERDNS=yes 
  24.  
  25. GATEWAY=192.168.168.250  
  26.  
  27. IPV6INIt=no 

2. Change the configuration file ifcfg-eth0 for eth0, the changed content is as follows

 
 
  1. Vi ifcfg-eth0  
  2.  
  3. DEVICE=eth0 
  4.  
  5. BOOTPROTO=none 
  6.  
  7. ONBOOT=yes 
  8.  
  9. TYPE=Ethernet 
  10.  
  11. USERCTL=no 
  12.  
  13. MASTER=bond0 
  14.  
  15. SLAVE=yes 

3. Add the configuration file ifcfg-eth2 of eth2

 
 
  1. Vi ifcfg-eth2  
  2.  
  3. DEVICE=eth2 
  4.  
  5. BOOTPROTO=none 
  6.  
  7. ONBOOT=yes 
  8.  
  9. TYPE=Ethernet 
  10.  
  11. USERCTL=no 
  12.  
  13. MASTER=bond0 
  14.  
  15. SLAVE=yes 

4. Because the linux virtual Nic is implemented in the kernel module, you must install the module. Add the following content to the/etc/modules. conf file. If the file does not exist, create a new one ):

 
 
  1. alias bond0 bonding  
  2.  
  3. options bond0 miimon=100 mode=0 primary=eth0 

Among them, miimon = 100 indicates that the link connection status is checked every Ms. If not, the physical Nic is switched. mode = 1 indicates that the active and standby modes, that is, only one Nic is active, only failure protection is provided. If mode = 0, it is in Server Load balancer mode. All network adapters are active, and some other modes are rarely used. primary = eth0 indicates that eth0 is the default active network adapter in Master/Slave mode.

5. Add modprobe bonding miimon = 100 mode = 0 to/etc/rc. local.

6. Make the same modification on rac2.

7. It takes effect after restart. ifconfig-a check shows that the bond0 Nic is added, and the ip Address configuration of eth0 is configured. bond0 is also added to the graphic interface of network configuration.

5. Start gsd and ons of crs

Stop the database and crs on rac1 and rac2, and only start gsd and ons of crs.

 
 
  1. # Cd/u01/app/oracle/product/10.2.0/crs_1/bin
  2.  
  3. Stop a database instance
  4.  
  5. #./Srvctl stop instance-d devdb-I ora. devdb. devd1.inst
  6.  
  7. #./Srvctl stop instance-d devdb-I ora. devdb. devd2.inst
  8.  
  9. Stop Database
  10.  
  11. #./Srvctl stop database-d devdb
  12.  
  13. Stop an ASM instance
  14.  
  15. #./Srvctl stop asm-n rac1
  16.  
  17. #./Srvctl stop asm-n rac2
  18.  
  19. Stop vip, gsd, listener, ons
  20.  
  21. #./Srvctl stop nodeapps-n rac1
  22.  
  23. #./Srvctl stop nodeapps-n rac2
  24.  
  25. #./Crs_start ora. rac1.gsd
  26.  
  27. #./Crs_start ora. rac1.ons
  28.  
  29. #./Crs_start ora. rac2.gsd
  30.  
  31. #./Crs_start ora. rac2.ons

6. Change VIP to bond0 Nic as root user in rac1

 
 
  1. #cd  /u01/app/oracle/product/10.2.0/crs_1/bin  
  2.  
  3. #./srvctl modify nodeapps –n rac1 –A 192.168.2.13/255.255.255.0/bond0  
  4.  
  5. #./srvctl modify nodeapps –n rac1 –A  rac1-vip/255.255.255.0/bond0 

7. Change VIP to bond0 Nic as root user in rac2

 
 
  1. #cd  /u01/app/oracle/product/10.2.0/crs_1/bin  
  2.  
  3. #./srvctl modify nodeapps –n rac2 –A 192.168.2.14/255.255.255.0/bond0  
  4.  
  5. #./srvctl modify nodeapps –n rac2 –A  rac2-vip/255.255.255.0/bond0 

8. Confirm the changed vip configuration

 
 
  1. #./srvctl config nodeapps –n rac1 –a  
  2.  
  3. VIP exists.:/rac1-vip.mycorpdomain.com/192.168.2.13/255.255.255.0/bond0  
  4.  
  5. #./srvctl config nodeapps –n rac2 –a  
  6.  
  7. VIP exists.:/rac2-vip.mycorpdomain.com/192.168.2.14/255.255.255.0/bond0 

9. After the modification is completed, start the database-related process

 
 
  1. #./srvctl start nodeapps –n rac1  
  2.  
  3. #./srvctl start nodeapps –n rac2  
  4.  
  5. #./crs_start ora.rac1.ASM1.asm  
  6.  
  7. #./crs_start ora.rac2.ASM2.asm  
  8.  
  9. #./crs_start ora.devdb.db 

10. view the crs status

# Crs _ stat-t

It can be seen from the above that all processes are in normal state and bound successfully.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.