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
- # Cd/u01/app/oracle/product/10.2.0/crs_1/bin
-
- Stop a database instance
-
- #./Srvctl stop instance-d devdb-I ora. devdb. devd1.inst
-
- #./Srvctl stop instance-d devdb-I ora. devdb. devd2.inst
-
- Stop Database
-
- #./Srvctl stop database-d devdb
-
- Stop an ASM instance
-
- #./Srvctl stop asm-n rac1
-
- #./Srvctl stop asm-n rac2
-
- Stop vip, gsd, listener, ons
-
- #./Srvctl stop nodeapps-n rac1
-
- #./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/
- #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. Change the configuration file ifcfg-eth0 for eth0, the changed content is as follows
- Vi ifcfg-eth0
-
- DEVICE=eth0
-
- BOOTPROTO=none
-
- ONBOOT=yes
-
- TYPE=Ethernet
-
- USERCTL=no
-
- MASTER=bond0
-
- SLAVE=yes
3. Add the configuration file ifcfg-eth2 of eth2
- Vi ifcfg-eth2
-
- DEVICE=eth2
-
- BOOTPROTO=none
-
- ONBOOT=yes
-
- TYPE=Ethernet
-
- USERCTL=no
-
- MASTER=bond0
-
- 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 ):
- alias bond0 bonding
-
- 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.
- # Cd/u01/app/oracle/product/10.2.0/crs_1/bin
-
- Stop a database instance
-
- #./Srvctl stop instance-d devdb-I ora. devdb. devd1.inst
-
- #./Srvctl stop instance-d devdb-I ora. devdb. devd2.inst
-
- Stop Database
-
- #./Srvctl stop database-d devdb
-
- Stop an ASM instance
-
- #./Srvctl stop asm-n rac1
-
- #./Srvctl stop asm-n rac2
-
- Stop vip, gsd, listener, ons
-
- #./Srvctl stop nodeapps-n rac1
-
- #./Srvctl stop nodeapps-n rac2
-
- #./Crs_start ora. rac1.gsd
-
- #./Crs_start ora. rac1.ons
-
- #./Crs_start ora. rac2.gsd
-
- #./Crs_start ora. rac2.ons
6. Change VIP to bond0 Nic as root user in rac1
- #cd /u01/app/oracle/product/10.2.0/crs_1/bin
-
- #./srvctl modify nodeapps –n rac1 –A 192.168.2.13/255.255.255.0/bond0
-
- #./srvctl modify nodeapps –n rac1 –A rac1-vip/255.255.255.0/bond0
7. Change VIP to bond0 Nic as root user in rac2
- #cd /u01/app/oracle/product/10.2.0/crs_1/bin
-
- #./srvctl modify nodeapps –n rac2 –A 192.168.2.14/255.255.255.0/bond0
-
- #./srvctl modify nodeapps –n rac2 –A rac2-vip/255.255.255.0/bond0
8. Confirm the changed vip configuration
- #./srvctl config nodeapps –n rac1 –a
-
- VIP exists.:/rac1-vip.mycorpdomain.com/192.168.2.13/255.255.255.0/bond0
-
- #./srvctl config nodeapps –n rac2 –a
-
- 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
- #./srvctl start nodeapps –n rac1
-
- #./srvctl start nodeapps –n rac2
-
- #./crs_start ora.rac1.ASM1.asm
-
- #./crs_start ora.rac2.ASM2.asm
-
- #./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.