zoukankan      html  css  js  c++  java
  • 手工模拟vip切换

    环境:

    OS:Centos 7

    DB:11.2.0.4

    1.在rac1上查看各节点的信息
    [grid@host01 ~]$ crs_stat -t -v
    Name Type R/RA F/FT Target State Host
    ----------------------------------------------------------------------
    ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE host01
    ora....TEST.dg ora....up.type 0/5 0/ ONLINE ONLINE host01
    ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE host01
    ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE host01
    ora.OCR.dg ora....up.type 0/5 0/ ONLINE ONLINE host01
    ora.REDO.dg ora....up.type 0/5 0/ ONLINE ONLINE host01
    ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE host01
    ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE host01
    ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
    ora....SM1.asm application 0/5 0/0 ONLINE ONLINE host01
    ora....01.lsnr application 0/5 0/0 ONLINE ONLINE host01
    ora.host01.gsd application 0/5 0/0 OFFLINE OFFLINE
    ora.host01.ons application 0/3 0/0 ONLINE ONLINE host01
    ora.host01.vip ora....t1.type 0/0 0/0 ONLINE ONLINE host01
    ora....SM2.asm application 0/5 0/0 ONLINE ONLINE host02
    ora....02.lsnr application 0/5 0/0 ONLINE ONLINE host02
    ora.host02.gsd application 0/5 0/0 OFFLINE OFFLINE
    ora.host02.ons application 0/3 0/0 ONLINE ONLINE host02
    ora.host02.vip ora....t1.type 0/0 0/0 ONLINE ONLINE host02
    ora....network ora....rk.type 0/5 0/ ONLINE ONLINE host01
    ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE host01
    ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE host01
    ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE host01
    ora.slnngk.db ora....se.type 0/2 0/1 ONLINE ONLINE host01
    ora...._s1.svc ora....ce.type 0/0 0/0 ONLINE ONLINE host01
    ora...._s2.svc ora....ce.type 0/0 0/0 ONLINE ONLINE host01

    2.模拟停掉rac1上的vip
    [root@host01 ~]# ifconfig -a
    enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.56.141 netmask 255.255.255.0 broadcast 192.168.56.255
    inet6 fe80::755d:3751:170:bda2 prefixlen 64 scopeid 0x20<link>
    ether 08:00:27:f5:de:7d txqueuelen 1000 (Ethernet)
    RX packets 2492 bytes 245829 (240.0 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 2276 bytes 317323 (309.8 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    enp0s3:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.56.188 netmask 255.255.255.0 broadcast 192.168.56.255
    ether 08:00:27:f5:de:7d txqueuelen 1000 (Ethernet)

    enp0s3:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.56.131 netmask 255.255.255.0 broadcast 192.168.56.255
    ether 08:00:27:f5:de:7d txqueuelen 1000 (Ethernet)

    enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 172.16.1.3 netmask 255.255.255.0 broadcast 172.16.1.255
    inet6 fe80::a00:27ff:fe11:d9db prefixlen 64 scopeid 0x20<link>
    ether 08:00:27:11:d9:db txqueuelen 1000 (Ethernet)
    RX packets 132716 bytes 80144376 (76.4 MiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 167510 bytes 182900731 (174.4 MiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    enp0s8:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 169.254.223.135 netmask 255.255.0.0 broadcast 169.254.255.255
    ether 08:00:27:11:d9:db 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 1 (Local Loopback)
    RX packets 54022 bytes 22611081 (21.5 MiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 54022 bytes 22611081 (21.5 MiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    host文件配置信息
    [root@host01 ~]# more /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6


    192.168.56.141 host01
    192.168.56.142 host02
    192.168.56.131 host01-vip
    192.168.56.132 host02-vip
    172.16.1.3 host01-priv
    172.16.1.4 host02-priv
    192.168.56.188 rac-scan

    模拟停掉
    [root@host01 ~]# ifconfig enp0s3:2 down


    可以看到目前是failedover

    [grid@host01 ~]$ crsctl stat res -t
    --------------------------------------------------------------------------------
    NAME TARGET STATE SERVER STATE_DETAILS
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
    ONLINE ONLINE host01
    ONLINE ONLINE host02
    ora.DATATEST.dg
    ONLINE ONLINE host01
    ONLINE ONLINE host02
    ora.LISTENER.lsnr
    ONLINE OFFLINE host01
    ONLINE ONLINE host02
    ora.OCR.dg
    ONLINE ONLINE host01
    ONLINE ONLINE host02
    ora.REDO.dg
    ONLINE ONLINE host01
    ONLINE ONLINE host02
    ora.asm
    ONLINE ONLINE host01 Started
    ONLINE ONLINE host02 Started
    ora.gsd
    OFFLINE OFFLINE host01
    OFFLINE OFFLINE host02
    ora.net1.network
    ONLINE ONLINE host01
    ONLINE ONLINE host02
    ora.ons
    ONLINE ONLINE host01
    ONLINE ONLINE host02
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.LISTENER_SCAN1.lsnr
    1 ONLINE ONLINE host01
    ora.cvu
    1 ONLINE ONLINE host01
    ora.host01.vip
    1 ONLINE INTERMEDIATE host02 FAILED OVER
    ora.host02.vip
    1 ONLINE ONLINE host02
    ora.oc4j
    1 ONLINE ONLINE host01
    ora.scan1.vip
    1 ONLINE ONLINE host01
    ora.slnngk.db
    1 ONLINE ONLINE host01 Open
    2 ONLINE ONLINE host02 Open
    ora.slnngk.service_s1.svc
    1 ONLINE ONLINE host02
    ora.slnngk.service_s2.svc
    1 ONLINE ONLINE host02

    可以看到host1的vip漂移到了host2

    3.手工漂移回来
    等host1的网络正常后,可以手工漂移回来
    [grid@host01 ~]$ srvctl relocate vip -help
    Relocate VIP from its current node to another node of the cluster.

    Usage: srvctl relocate vip -i <vip_name> [-n <node_name>] [-f] [-v]
    -i <vip_name> VIP name ##这个名字是实例主机名
    -n <node_name> Target node name to which to relocate
    -f Force relocation
    -v Verbose output
    -h Print usage

    手工漂移回来
    srvctl relocate vip -i host01 -n host01

    -- The End --

  • 相关阅读:
    CSU 1554 SG Value (集合类的学习)
    CSUOJ 1542 线段树解决括号反向问题
    POJ 1679 判最小生成树的不唯一性 或 利用次小生成树求解
    HDU1074 Doing Homework 状态压缩dp
    POJ 2479 两段连续最大和
    HDU1024 多段最大和 DP
    HDU 4803 贪心
    POJ 3469 网络流最小割
    SPOJ ARCTAN
    COJ 1163 乘法逆元的求解
  • 原文地址:https://www.cnblogs.com/hxlasky/p/12388558.html
Copyright © 2011-2022 走看看