從11.2.0.2開始,Oracle 的叢集軟體Grid Infrastructure(GI)中新增了Redundant Interconnect with Highly Available IP(HAIP),以實現叢集私網的高可用性和負載平衡。
在11.2.0.2之前,私網的冗餘一般是通過在OS上做網卡綁(如bonding, EtherChannel等)實現的,有了HAIP之後,無需使用網卡綁定就可以實現私網網卡的冗餘。
在安裝GI的過程中,可以定義多個私網網卡來實現私網的冗餘,
安裝後,HAIP地址自動化佈建為169.254.*.*,這個地址不可以手動設定。HAIP 最少為1個,最多為4個(1塊網卡,1個HAIP;2塊網卡,2個HAIP; 3塊及以上,4個HAIP), 均勻的分布在私網的網卡上。
案例:
1. 查看HAIP資源狀態
$ crsctl stat res -t -init
NAME
TARGET STATE SERVER STATE_DETAILS Cluster Resources
-------------------------------------------------------------------------------------------------
ora.cluster_interconnect.haip
ONLINE ONLINE node2 1
2.查看HAIP地址和分布情況。
#ifconfig -a
eth1 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:66
inet addr:192.168.254.32 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4b:b766/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
......
eth1:1 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:66
inet addr:169.254.31.199 Bcast:169.254.127.255 Mask:255.255.128.0 <=====HAIP address one.
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:193 Base address:0x1800
eth2 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:70
inet addr:192.168.254.33 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4b:b770/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
......
eth2:1 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:70
inet addr:169.254.185.222 Bcast:169.254.255.255 Mask:255.255.128.0 <=====HAIP address two.
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Base address:0x1880
haip均勻的分布在兩個私網網卡上。
3. 斷掉網卡eth1之後。
eth2 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:70
inet addr:192.168.254.33 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4b:b770/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3206 errors:0 dropped:0 overruns:0 frame:0
TX packets:3916 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1474658 (1.4 MiB) TX bytes:2838774 (2.7 MiB)
Interrupt:169 Base address:0x1880
eth2:1 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:70
inet addr:169.254.185.222 Bcast:169.254.255.255 Mask:255.255.128.0 <=====HAIP address two.
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Base address:0x1880
eth2:2 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:70
inet addr:169.254.31.199 Bcast:169.254.127.255 Mask:255.255.128.0 <=====HAIP address one.
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Base address:0x1880
HAIP one 漂移到了網卡eth2上。
4. 網卡eth1恢複之後。
eth1 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:66
inet addr:192.168.254.32 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4b:b766/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
......
eth1:1 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:66
inet addr:169.254.31.199 Bcast:169.254.127.255 Mask:255.255.128.0 <=====HAIP address one.
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:193 Base address:0x1800
eth2 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:70
inet addr:192.168.254.33 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4b:b770/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
......
eth2:1 Link encap:Ethernet HWaddr 00:0C:29:4B:B7:70
inet addr:169.254.185.222 Bcast:169.254.255.255 Mask:255.255.128.0 <=====HAIP address two.
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Base address:0x1880
HAIP one 回到了網卡eth1上。
注意:HAIP地址失敗不會對ocssd產生影響,也就是說HAIP失敗,不會導致節點重啟。
HAIP 對資料庫和ASM的影響
資料庫和ASM執行個體使用這個HAIP作為cluster interconnect,以下是alert.log的片段。
Cluster communication is configured to use the following interface(s) for this instance
169.254.31.199
169.254.185.222
cluster interconnect IPC version:Oracle UDP/IP (generic)
IPC Vendor 1 proto 2
Oracle資料庫和ASM執行個體可以通過HAIP來實現私網通訊的高可用性和負載平衡。私網的流量會在這些私網網卡上實現負載平衡,
如果某個網卡出現了故障,它上面的HAIP會自動切換到別的可用的私網網卡上,從而不影響私網的通訊。
注意:HAIP 是不允許被手動停止或禁用的,除非是由於某些版本或者平台不支援。
關於HAIP的更多介紹,請參考My Oracle Support Note 文檔1210883.1.