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 --
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?