11G Highly Available Virtual IP (haip)

gaopengtttt發表於2013-02-18

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,
這個還需要隨後測試下。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7728585/viewspace-754264/,如需轉載,請註明出處,否則將追究法律責任。

相關文章