oracle rac 添加SCAN IP

环境:
OS:Centos 7
DB:19.3.0.0 2节点RAC

 

1.查看scan的配置信息
[grid@rac01 ~]$ srvctl config scan
SCAN name: rac-scan, Network: 1
Subnet IPv4: 192.168.56.0/255.255.255.0/enp0s3, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 192.168.56.199
SCAN VIP is enabled.

2.查看scan的状态以及scan ip所处节点
[grid@rac01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac02

3.查看scan listener
[grid@rac01 ~]$ srvctl config scan_listener
SCAN Listeners for network 1:
Registration invited nodes:
Registration invited subnets:
Endpoints: TCP:1521
SCAN Listener LISTENER_SCAN1 exists
SCAN Listener is enabled.

4.修改rac所有节点的/etc/hosts信息
[root@rac01 ~]# more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.191  rac01
192.168.56.192  rac02
192.168.56.201  rac01-vip
192.168.56.202  rac02-vip
10.10.10.1          rac01-priv
10.10.10.2          rac02-priv
192.168.56.199  rac-scan
192.168.56.188  rac-scan ##新增

5.停止scan 监听,注意先听监听才能停scan
[grid@rac01 ~]$ srvctl stop scan_listener
[grid@rac01 ~]$ srvctl stop scan
[grid@rac01 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running

6.配置scan,注意需要用root权限执行
[root@db1 bin]#/u01/grid/grid_home/19.3.0.0/bin/srvctl modify scan -n rac-scan ##修改scan信息,-n后面接 hosts中的san ip网络名
[root@db1 bin]#/u01/grid/grid_home/19.3.0.0/bin/srvctl modify scan_listener -u ##添加scanIP的监听,若不执行该命令,将只有一个listener_scan1监听,执行后将根据scan ip数自动增加listener_scan2,listener_scan3.

7.启动scan
[grid@rac01 ~]$ srvctl start scan
[grid@rac01 ~]$ srvctl start scan_listener
[grid@rac01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rac02

8.删除其中一个rac-scan
跟上面添加的步骤一致
所有节点修改/etc/hosts文件,将要删除的ip在配置文件中去掉

在其中一个节点上操作即可
grid用户
[grid@rac01 ~]$ srvctl stop scan_listener
[grid@rac01 ~]$ srvctl stop scan

root用户
[root@rac01 ~]# /u01/grid/grid_home/19.3.0.0/bin/srvctl modify scan -n rac-scan
[root@rac01 ~]# /u01/grid/grid_home/19.3.0.0/bin/srvctl modify scan_listener -u

grid用户
[grid@rac01 ~]$srvctl start scan
[grid@rac01 ~]$srvctl start scan_listener
[grid@rac01 ~]$srvctl status scan

posted @ 2022-03-22 09:43  slnngk  阅读(1087)  评论(0编辑  收藏  举报