oracle rac手动切换scan ip到集群其他节点

srvctl relocate scan用法:
[grid@rac1 ~]$ srvctl relocate scan -h

将 SCAN VIP 从集群的一个节点临时重新定位到另一个节点。

用法: srvctl relocate scan -i <ordinal_number> [-n <node_name>]
    -i <scan_ordinal_number> IP 地址的序数
    -n <node_name>           SCAN VIP 节点名
    -h                       输出用法
    
一、背景
1)节点一ip配置
#rac1
192.168.162.10      rac1
192.168.162.11      rac1-vip
10.10.10.11         rac1-priv

#rac2
192.168.162.12      rac2
192.168.162.13      rac2-vip
10.10.10.12         rac2-priv

#scan-ip
192.168.162.14      scan-cluster

2)节点二ip配置
#rac1
192.168.162.10      rac1
192.168.162.11     rac1-vip
10.10.10.11         rac1-priv

#rac2
192.168.162.12      rac2
192.168.162.13      rac2-vip
10.10.10.12         rac2-priv

#scan-ip
192.168.162.14      scan-cluster

二、手动切换scan ip到集群其他节点:
1)查看节点一,节点二scan ip切换前ip以及listener_scan1状态
节点一:
[grid@rac1 ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:23:a9:13 brd ff:ff:ff:ff:ff:ff
    inet 192.168.162.10/24 brd 192.168.162.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.162.14/24 brd 192.168.162.255 scope global secondary eth0:1
       valid_lft forever preferred_lft forever
    inet 192.168.162.11/24 brd 192.168.162.255 scope global secondary eth0:3
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe23:a913/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:21:3a:ae brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.11/24 brd 10.10.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 169.254.83.129/16 brd 169.254.255.255 scope global eth1:1
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe21:3aae/64 scope link
       valid_lft forever preferred_lft forever
       
[grid@rac1 admin]$ lsnrctl status listener_scan1

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-AUG-2022 16:01:46

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                14-AUG-2022 16:01:04
Uptime                    0 days 0 hr. 0 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/11.2.0/grid/log/diag/tnslsnr/rac1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.14)(PORT=1521)))
Services Summary...
Service "racdb" has 2 instance(s).
  Instance "racdb1", status READY, has 1 handler(s) for this service...
  Instance "racdb2", status READY, has 1 handler(s) for this service...
Service "racdbXDB" has 2 instance(s).
  Instance "racdb1", status READY, has 1 handler(s) for this service...
  Instance "racdb2", status READY, has 1 handler(s) for this service...
The command completed successfully

节点二:
[grid@rac2 ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:39:52:22 brd ff:ff:ff:ff:ff:ff
    inet 192.168.162.12/24 brd 192.168.162.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.162.13/24 brd 192.168.162.255 scope global secondary eth0:1
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe39:5222/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:2b:28:e0 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.12/24 brd 10.10.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 169.254.211.144/16 brd 169.254.255.255 scope global eth1:1
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe2b:28e0/64 scope link
       valid_lft forever preferred_lft forever

[grid@rac2 ~]$ lsnrctl status listener_scan1

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-AUG-2022 16:01:36

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
          
2)手动切换scan ip
[grid@rac1 ~]$ srvctl relocate scan -i 1 -n rac2

3)查看节点一,节点二scan ip切换后ip以及listener_scan1状态
节点一:
[grid@rac1 ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:23:a9:13 brd ff:ff:ff:ff:ff:ff
    inet 192.168.162.10/24 brd 192.168.162.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.162.11/24 brd 192.168.162.255 scope global secondary eth0:3
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe23:a913/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:21:3a:ae brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.11/24 brd 10.10.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 169.254.83.129/16 brd 169.254.255.255 scope global eth1:1
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe21:3aae/64 scope link
       valid_lft forever preferred_lft forever

[grid@rac1 admin]$ lsnrctl status listener_scan1

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-AUG-2022 16:12:04

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
       
节点二:
[grid@rac2 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:39:52:22 brd ff:ff:ff:ff:ff:ff
    inet 192.168.162.12/24 brd 192.168.162.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.162.13/24 brd 192.168.162.255 scope global secondary eth0:1
       valid_lft forever preferred_lft forever
    inet 192.168.162.14/24 brd 192.168.162.255 scope global secondary eth0:2
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe39:5222/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:2b:28:e0 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.12/24 brd 10.10.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 169.254.211.144/16 brd 169.254.255.255 scope global eth1:1
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe2b:28e0/64 scope link
       valid_lft forever preferred_lft forever
       
[grid@rac2 ~]$ lsnrctl status listener_scan1

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-AUG-2022 16:11:54

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                14-AUG-2022 16:11:41
Uptime                    0 days 0 hr. 0 min. 13 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/11.2.0/grid/log/diag/tnslsnr/rac2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.14)(PORT=1521)))
Services Summary...
Service "racdb" has 2 instance(s).
  Instance "racdb1", status READY, has 1 handler(s) for this service...
  Instance "racdb2", status READY, has 1 handler(s) for this service...
Service "racdbXDB" has 2 instance(s).
  Instance "racdb1", status READY, has 1 handler(s) for this service...
  Instance "racdb2", status READY, has 1 handler(s) for this service...
The command completed successfully
       
由上可见scan ip 192.168.162.14被成功切换到节点二。

  

posted @ 2022-08-15 09:42  orcl  阅读(2212)  评论(0编辑  收藏  举报