18C VIP手工切换
场景:
模拟节点2=host02上的vip故障漂移到节点1=host01后,手工切换回到节点2=host02
1.查看资源情况
[grid@host02 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.OCR.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.chad
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.net1.network
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.ons
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE host01 STABLE
ora.MGMTLSNR
1 ONLINE ONLINE host01 169.254.25.129 10.10
.10.1,STABLE
ora.asm
1 ONLINE ONLINE host01 Started,STABLE
2 ONLINE ONLINE host02 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE host01 STABLE
ora.host01.vip
1 ONLINE ONLINE host01 STABLE
ora.host02.vip
1 ONLINE ONLINE host02 STABLE
ora.mgmtdb
1 ONLINE ONLINE host01 Open,STABLE
ora.qosmserver
1 ONLINE ONLINE host01 STABLE
ora.scan1.vip
1 ONLINE ONLINE host01 STABLE
--------------------------------------------------------------------------------
从上面的输出看出 ora.host02.vip 是漂移在host02上面的,下面我们模拟将该vip停掉
2.网卡信息
[root@host02 bin]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.58.102 netmask 255.255.255.0 broadcast 192.168.58.255
inet6 fe80::8130:146b:5386:296c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:87:7b:1f txqueuelen 1000 (Ethernet)
RX packets 42134 bytes 9306581 (8.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 37845 bytes 11088387 (10.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.58.202 netmask 255.255.255.0 broadcast 192.168.58.255
ether 00:0c:29:87:7b:1f txqueuelen 1000 (Ethernet)
ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.2 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::609d:3fbf:fc5d:3c93 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:87:7b:29 txqueuelen 1000 (Ethernet)
RX packets 2448845 bytes 1796118725 (1.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3061785 bytes 2975363230 (2.7 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens37:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.18.140 netmask 255.255.224.0 broadcast 169.254.31.255
ether 00:0c:29:87:7b:29 txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 572045 bytes 194524773 (185.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 572045 bytes 194524773 (185.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
3.手工停掉
[root@host02 bin]#ifconfig ens33:1 down
发现已经没有ens33:1的信息了
[root@host02 bin]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.58.102 netmask 255.255.255.0 broadcast 192.168.58.255
inet6 fe80::8130:146b:5386:296c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:87:7b:1f txqueuelen 1000 (Ethernet)
RX packets 42185 bytes 9311355 (8.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 37894 bytes 11099265 (10.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.2 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::609d:3fbf:fc5d:3c93 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:87:7b:29 txqueuelen 1000 (Ethernet)
RX packets 2457414 bytes 1802433024 (1.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3072255 bytes 2985365239 (2.7 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens37:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.18.140 netmask 255.255.224.0 broadcast 169.254.31.255
ether 00:0c:29:87:7b:29 txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 574025 bytes 195227937 (186.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 574025 bytes 195227937 (186.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
4.节点2=host02 的vip已经漂移到了节点1=host01
[grid@host02 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE host01 STABLE
ONLINE OFFLINE host02 STABLE
ora.OCR.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.chad
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.net1.network
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ora.ons
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE host01 STABLE
ora.MGMTLSNR
1 ONLINE ONLINE host01 169.254.25.129 10.10
.10.1,STABLE
ora.asm
1 ONLINE ONLINE host01 Started,STABLE
2 ONLINE ONLINE host02 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE host01 STABLE
ora.host01.vip
1 ONLINE ONLINE host01 STABLE
ora.host02.vip
1 ONLINE INTERMEDIATE host01 FAILED OVER,STABLE
ora.mgmtdb
1 ONLINE ONLINE host01 Open,STABLE
ora.qosmserver
1 ONLINE ONLINE host01 STABLE
ora.scan1.vip
1 ONLINE ONLINE host01 STABLE
--------------------------------------------------------------------------------
5.在节点1=host01上可以看到192.168.58.202已经漂移过来了
[root@host01 admin]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.58.101 netmask 255.255.255.0 broadcast 192.168.58.255
inet6 fe80::bf13:ec37:b778:daec prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:73:89:40 txqueuelen 1000 (Ethernet)
RX packets 50997 bytes 12143397 (11.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 60042 bytes 35597852 (33.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.58.201 netmask 255.255.255.0 broadcast 192.168.58.255
ether 00:0c:29:73:89:40 txqueuelen 1000 (Ethernet)
ens33:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.58.199 netmask 255.255.255.0 broadcast 192.168.58.255
ether 00:0c:29:73:89:40 txqueuelen 1000 (Ethernet)
ens33:3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.58.202 netmask 255.255.255.0 broadcast 192.168.58.255
ether 00:0c:29:73:89:40 txqueuelen 1000 (Ethernet)
ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.1 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::e364:f8b5:eae3:78d6 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:73:89:4a txqueuelen 1000 (Ethernet)
RX packets 3078888 bytes 2752321987 (2.5 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2462908 bytes 1806224257 (1.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens37:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.25.129 netmask 255.255.224.0 broadcast 169.254.31.255
ether 00:0c:29:73:89:4a txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2226427 bytes 1422177407 (1.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2226427 bytes 1422177407 (1.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:e4:7c:4e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0-nic: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:e4:7c:4e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
6.手工漂移回来
srvctl relocate vip -i host02 -n host02
说明不需要进行手工up vip网卡的
[root@host02 bin]# ifconfig ens33:1 up
SIOCSIFFLAGS: Cannot assign requested address
-- The End --