Highly Available Virtual IP
Starting with Oracle RAC 11.2.0.2, Oracle has introduced Redundant Interconnect Usage feature to support IP failover. Oracle uses its ora.cluster_interconnect.haip resource to provide this functionality. The Highly Available Internet Protocol (HAIP) has the ability to activate a maximum of four private interconnect connections. These private network adapters can be configured during the initial installation process of Oracle Grid Infrastructure or after the installation process using the oifcfg utility.
Oracle Grid Infrastructure currently creates an alias IP (known as virtual private IP) on private network interface using the 169.254.*.* subnet for the HAIP. However, if that subnet range is already in use, Oracle Grid Infrastructure will not attempt to use it. The purpose of HAIP is to perform. load balancing across all active interconnect interfaces, and fail over existing non-responsive interfaces to other available interfaces.
Note: interconnect will use virtual private IP 169.254.167.163 instead of real private IP. For pre-11.2.0.2 instance, by default it will still use the real private IP; to take advantage of the new feature, init.ora parameter cluster_interconnects can be updated each time Grid is restarted .
NOTE: If using the 11.2.0.2 (and above) Redundant Interconnect/HAIP feature (as documented in CASE 2 below) - At present it is REQUIRED that all interconnect interfaces be placed on separate subnets. If the interfaces are all on the same subnet and the cable is pulled from the first NIC in the routing table a rebootless-restart or node reboot will occur.
11G从11.2.0.2 开始加入了haip的功能,其资源名称为ora.cluster_interconnect.haip ,功能类似SCAN IP,,加入了虚拟IP 在169.254.*.*网段,此虚拟机IP能够在多个节点之间漂移,实际的通信也是通过这个IP进行的,而且文档上说是热备,及正常情况下两条心跳或者多条心跳都是可用的。当使用HAIP如果你只有一个私有网卡那就使用一个HAIP,如果你有2块就建立2个HAIP,如果是2个以上就建立4个。当然每套私有网卡都必须在不同的网段上
下面测试一下,我已经有了一个3节点集群。
首先在任一节点查询当前的网卡配置
[grid@rac2 ~]$ oifcfg getif
eth1 10.0.0.0 global cluster_interconnect --私有
eth0 172.16.14.0 global public ---公有
[grid@rac2 ~]$ oifcfg iflist
eth0 172.16.14.0
eth1 10.0.0.0
eth1 169.254.0.0 --- haip
ifconfig 可以看到如下的信息:
eth1:1 Link encap:Ethernet HWaddr 00:50:56:B0:00:58
inet addr:169.254.152.228 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x2c40 Memory:d8940000-d8960000
这个就是虚拟机的私有IP
也可以通过各个实例执行
select name,ip_address from v$cluster_interconnects;
进行查询HAIP
增加一块私有网卡
启动操作系统设置好IP
启动3节点的CRS
/oracle/app/grid/product/11.2.0/bin/crsctl start crs
设置新的私有网卡
/oracle/app/grid/product/11.2.0/bin/oifcfg setif -global eth2/10.10.11.0:cluster_interconnect
重新启动所有节点的CRS
查看配置
[root@rac2 peer]# /oracle/app/grid/product/11.2.0/bin/oifcfg iflist -p -n
eth0 172.16.14.0 PRIVATE 255.255.255.0
eth1 10.10.10.0 PRIVATE 255.255.255.0
eth1 169.254.0.0 UNKNOWN 255.255.128.0
eth2 10.10.11.0 PRIVATE 255.255.255.0
eth2 169.254.128.0 UNKNOWN 255.255.128.0
查看
eth1 Link encap:Ethernet HWaddr 00:50:56:B0:00:57
inet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:feb0:57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:218928 errors:0 dropped:0 overruns:0 frame.:0
TX packets:242751 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:125886078 (120.0 MiB) TX bytes:160243706 (152.8 MiB)
Base address:0x2c40 Memory:d8960000-d8980000
eth1:1 Link encap:Ethernet HWaddr 00:50:56:B0:00:57
inet addr:169.254.40.143 Bcast:169.254.127.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x2c40 Memory:d8960000-d8980000
eth2 Link encap:Ethernet HWaddr 00:50:56:B0:00:14
inet addr:10.10.11.1 Bcast:10.10.11.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:feb0:14/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:33853 errors:0 dropped:0 overruns:0 frame.:0
TX packets:35510 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13739000 (13.1 MiB) TX bytes:26247347 (25.0 MiB)
Base address:0x2c80 Memory:d8a40000-d8a60000
eth2:1 Link encap:Ethernet HWaddr 00:50:56:B0:00:14
inet addr:169.254.194.254 Bcast:169.254.255.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x2c80 Memory:d8a40000-d8a60000
发现已经可以看到新配置的虚拟网卡。这里可以但不是必须把私有网卡2的解析加入到HOSTS,因为oifcfg配置是不需要解析的,
haip之所以容灾,是因为当我们的EHT1故障后,ETH1:1的IP会漂移到eth2上,形成eth2:2,
这个还需要随后测试下。