在日常维护中,由于各种情况需要对rac的网络进行调整譬如:网卡名字修改,网卡功能调整,公网业务网络、私网心跳单网卡转双网卡调整;本次测试将rac私网心跳由一个网卡转变为多个网卡进行通讯,使用到的结束rac haip的心跳技术来实现;当然也可以使用操作系统层面的bond、etherchanel等技术来实现;
步骤说明:
1、查看现在的网卡状态;
2、配置网卡ip:
3、添加haip ip;
4、重启集群软件(这里需要注意,需要两节点同时重启;如果只是启动crs,haip配置是无效的,如果是分别重启也是无效的,看官可以自行try it);
实验步骤:
集群状态:
[grid@rac1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.cube.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2
检查现有集群网络配置及网络情况:
[grid@rac1 ~]$ ifconfigeth0 Link encap:Ethernet HWaddr 08:00:27:6C:FD:86
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe6c:fd86/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:263 errors:0 dropped:0 overruns:0 frame:0
TX packets:230 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33821 (33.0 KiB) TX bytes:43001 (41.9 KiB)
eth0:1 Link encap:Ethernet HWaddr 08:00:27:6C:FD:86
inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:2 Link encap:Ethernet HWaddr 08:00:27:6C:FD:86
inet addr:192.168.1.13 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:F7:67:C6
inet addr:10.10.10.10 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fef7:67c6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19636 errors:0 dropped:0 overruns:0 frame:0
TX packets:42250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9018656 (8.6 MiB) TX bytes:40207717 (38.3 MiB)
eth1:1 Link encap:Ethernet HWaddr 08:00:27:F7:67:C6
inet addr:169.254.90.64 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth2 Link encap:Ethernet HWaddr 08:00:27:43:81:9A
inet addr:10.10.10.11 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe43:819a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:166 errors:0 dropped:0 overruns:0 frame:0
TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:48563 (47.4 KiB) TX bytes:10215 (9.9 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8985 errors:0 dropped:0 overruns:0 frame:0
TX packets:8985 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4479569 (4.2 MiB) TX bytes:4479569 (4.2 MiB)
[root@rac2 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:F0:FF:4E
inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fef0:ff4e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:181 errors:0 dropped:0 overruns:0 frame:0
TX packets:183 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:29034 (28.3 KiB) TX bytes:34088 (33.2 KiB)
eth0:2 Link encap:Ethernet HWaddr 08:00:27:F0:FF:4E
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:A2:81:DC
inet addr:10.10.10.20 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea2:81dc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:42443 errors:0 dropped:0 overruns:0 frame:0
TX packets:19786 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:40272284 (38.4 MiB) TX bytes:9145900 (8.7 MiB)
eth1:1 Link encap:Ethernet HWaddr 08:00:27:A2:81:DC
inet addr:169.254.173.83 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth2 Link encap:Ethernet HWaddr 08:00:27:FF:BC:F8
inet addr:10.10.10.21 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feff:bcf8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:241 errors:0 dropped:0 overruns:0 frame:0
TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60331 (58.9 KiB) TX bytes:10455 (10.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6575 errors:0 dropped:0 overruns:0 frame:0
TX packets:6575 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4678300 (4.4 MiB) TX bytes:4678300 (4.4 MiB)
[grid@rac1 ~]$ oifcfg getif
eth0 192.168.1.0 global public
eth1 10.10.10.0 global cluster_interconnect
[grid@rac1 ~]$ oifcfg iflist
eth0 192.168.1.0
eth1 10.10.10.0
eth1 169.254.0.0
eth2 10.10.10.0
将eth2 添加为心跳网卡
[grid@rac1 ~]$ oifcfg setif -global eth2/10.10.10.0:cluster_interconnect
[grid@rac1 ~]$ oifcfg getif
eth0 192.168.1.0 global public
eth1 10.10.10.0 global cluster_interconnect
eth2 10.10.10.0 global cluster_interconnect
重启has
[root@rac1 ~]# cd /u01/app/11.2.0/grid/bin/
[root@rac1 bin]# ./crsctl stop has
[root@rac2 ~]# cd /u01/app/11.2.0/grid/bin/
[root@rac2 bin]# ./crsctl stop has
[root@rac1 ~]# cd /u01/app/11.2.0/grid/bin/
[root@rac1 bin]# ./crsctl stat has
[root@rac2 ~]# cd /u01/app/11.2.0/grid/bin/
[root@rac2 bin]# ./crsctl start has
查看群集状态和网卡信息
[grid@rac1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cube.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
[root@rac1 bin]# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:6C:FD:86
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe6c:fd86/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:867 errors:0 dropped:0 overruns:0 frame:0
TX packets:708 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:97140 (94.8 KiB) TX bytes:125743 (122.7 KiB)
eth0:1 Link encap:Ethernet HWaddr 08:00:27:6C:FD:86
inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:2 Link encap:Ethernet HWaddr 08:00:27:6C:FD:86
inet addr:192.168.1.13 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:F7:67:C6
inet addr:10.10.10.10 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fef7:67c6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:38261 errors:0 dropped:0 overruns:0 frame:0
TX packets:61599 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20994198 (20.0 MiB) TX bytes:51007538 (48.6 MiB)
eth1:1 Link encap:Ethernet HWaddr 08:00:27:F7:67:C6
inet addr:169.254.112.191 Bcast:169.254.127.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth2 Link encap:Ethernet HWaddr 08:00:27:43:81:9A
inet addr:10.10.10.11 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe43:819a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4844 errors:0 dropped:0 overruns:0 frame:0
TX packets:4819 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1551433 (1.4 MiB) TX bytes:1783431 (1.7 MiB)
eth2:1 Link encap:Ethernet HWaddr 08:00:27:43:81:9A
inet addr:169.254.151.29 Bcast:169.254.255.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16368 errors:0 dropped:0 overruns:0 frame:0
TX packets:16368 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9059793 (8.6 MiB) TX bytes:9059793 (8.6 MiB)
[root@rac2 bin]# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:F0:FF:4E
inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fef0:ff4e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:561 errors:0 dropped:0 overruns:0 frame:0
TX packets:508 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:78101 (76.2 KiB) TX bytes:84301 (82.3 KiB)
eth0:2 Link encap:Ethernet HWaddr 08:00:27:F0:FF:4E
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:A2:81:DC
inet addr:10.10.10.20 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea2:81dc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:67303 errors:0 dropped:0 overruns:0 frame:0
TX packets:41105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:55715706 (53.1 MiB) TX bytes:22093268 (21.0 MiB)
eth1:1 Link encap:Ethernet HWaddr 08:00:27:A2:81:DC
inet addr:169.254.16.226 Bcast:169.254.127.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth2 Link encap:Ethernet HWaddr 08:00:27:FF:BC:F8
inet addr:10.10.10.21 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feff:bcf8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10879 errors:0 dropped:0 overruns:0 frame:0
TX packets:7401 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6801509 (6.4 MiB) TX bytes:2542104 (2.4 MiB)
eth2:1 Link encap:Ethernet HWaddr 08:00:27:FF:BC:F8
inet addr:169.254.135.79 Bcast:169.254.255.255 Mask:255.255.128.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14746 errors:0 dropped:0 overruns:0 frame:0
TX packets:14746 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:10759263 (10.2 MiB) TX bytes:10759263 (10.2 MiB)
总结:
至此心跳haip添加完成;看官可自行对后续进行测试,ifdown端口后看网络是否漂移等进行确认
haip知识点请阅读官方文档:https://docs.oracle.com/cd/E11882_01/server.112/e10803/config_cw.htm#HABPT5279