在配置ADG或者使用oracle 的集群管理应用的HA时(比如OGG),我们可能希望使用不同的网络,以避免ADG传输日志等对主生产网络的造成影响。
从11.2开始,我们可以使用crs管理多个网络资源(缺省只有network1),但是SCAN只能在多个网络中的一个上活动(缺省是network1,后续可以指定到不同网络上)。
然后,我们通常会配置专门为ADG传输日志的network2网络,但是在配置连接串时,只能使用vip(因为SCAN通常给主生产上的network1使用)。
.
从12.1开始,我们可以配置多个网络上的多个SCAN,比如我们配置ADG时,在network2上配置SCAN2。
具体配置如下:
–检查网卡接口对应的IP地址:
[root@rac1 ~]# ifconfig | egrep 'eth0' -A 1 | grep 'inet ' | cut -d : -f2 | cut -d ' ' -f1
192.168.56.61
192.168.56.63
[root@rac1 ~]# ifconfig | egrep 'eth2' -A 1 | grep 'inet ' | cut -d : -f2 | cut -d ' ' -f1
192.168.209.61
[root@rac1 ~]#
[root@rac2 ~]# ifconfig | egrep 'eth0' -A 1 | grep 'inet ' | cut -d : -f2 | cut -d ' ' -f1
192.168.56.62
192.168.56.64
192.168.56.65
[root@rac2 ~]# ifconfig | egrep 'eth2' -A 1 | grep 'inet ' | cut -d : -f2 | cut -d ' ' -f1
192.168.209.62
[root@rac2 ~]#
–添加新的public网络
[grid@rac1 ~]$ oifcfg getif
eth0 192.168.56.0 global public
eth1 192.168.60.0 global cluster_interconnect
[grid@rac1 ~]$
[grid@rac1 ~]$ oifcfg setif -global eth2/192.168.209.0:public
[grid@rac1 ~]$ oifcfg getif
eth0 192.168.56.0 global public
eth1 192.168.60.0 global cluster_interconnect
eth2 192.168.209.0 global public
[grid@rac1 ~]$
–检查网络定义,缺省只有一个网络定义:network1
[grid@rac1 ~]$ srvctl config network
Network 1 exists
Subnet IPv4: 192.168.56.0/255.255.255.0/eth0, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
[grid@rac1 ~]$
–添加新的网络集群资源(a new network cluster resource)
[root@rac1 ~]# ipcalc -bnm 192.168.209.61 255.255.255.0
NETMASK=255.255.255.0
BROADCAST=192.168.209.255
NETWORK=192.168.209.0
[root@rac1 ~]#
[root@rac1 ~]# srvctl add network -netnum 2 -subnet 192.168.209.0/255.255.255.0/eth2
[root@rac1 ~]#
[root@rac1 ~]# srvctl config network
Network 1 exists
Subnet IPv4: 192.168.56.0/255.255.255.0/eth0, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
Network 2 exists
Subnet IPv4: 192.168.209.0/255.255.255.0/eth2, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
[root@rac1 ~]#
这时集群的网络资源中已经配置了两个网络(包括新增加的网络),如果使用“crsctl status res -t”查看,可以看到:
[root@rac1 ~]# crsctl status res -t |grep -A 2 network
ora.net1.network
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.net2.network
OFFLINE OFFLINE rac1 STABLE
OFFLINE OFFLINE rac2 STABLE
[root@rac1 ~]#
–添加vip
[root@rac1 ~]# srvctl add vip -node rac1 -netnum 2 -address rac1-adg-vip/255.255.255.0/eth2
[root@rac1 ~]# srvctl add vip -node rac2 -netnum 2 -address rac2-adg-vip/255.255.255.0/eth2
[root@rac1 ~]# srvctl config vip -n rac1
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 192.168.56.63
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists: network number 2, hosting node rac1
VIP Name: rac1-adg-vip
VIP IPv4 Address: 192.168.209.63
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
[root@rac1 ~]# srvctl config vip -n rac2
VIP exists: network number 1, hosting node rac2
VIP Name: rac2-vip
VIP IPv4 Address: 192.168.56.64
VIP IPv6 Address:
VIP is enabled.
VIP