本文只介绍同网段公网IP、虚拟IP以及scan的变更,稍后会介绍跨网段的IP变更。
实验环境:
1、停止RAC集群服务
在两个节点分别停止集群服务:
[[email protected] ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster -all
[[email protected] ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs
[[email protected] ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs
2、更改hosts文件或者dns记录
这里使用了hosts文件,直接编辑即可。如果使用了dns,需要修改dns的解析记录。若解析不成功会导致变更失败。
3、重启各个RAC节点
由于变更了公网IP,需要重启才能生效。重启完成后,对应的公网IP和虚拟IP都会改变。而oracle集群服务也会自动启动,并把新的公网IP和虚拟IP信息写入ocr中。到此,公网IP和虚拟IP变更完成。
4、变更scan名称以及IP
- 检查当前scan信息
[[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl config scan SCAN name: scan01, Network: 1/192.168.120.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: /scan01/192.168.120.37
- 停止SCAN以及scan listener服务
[[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl stop scan_listener [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl stop scan [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is not running [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is not running
- 变更scan信息
这里将scan01变更为scan02,ip由192.168.120.37变更为192.168.120.42。在更改前,确保新的scan可以通过dns解析或者以加入hosts文件,否则会出现如下报错: [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl modify scan -n scan02 PRCS-1016 : Failed to resolve Single Client Access Name scan02 变更后验证: [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl config scan SCAN name: scan02, Network: 1/192.168.120.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: /scan02/192.168.120.42
- 启动scan服务
[[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl start scan [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl start scan_listener [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is running on node odb10 [[email protected] ~]# /u01/app/11.2.0/grid/bin/srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is running on node odb10
由于变更scan名称,所以还需要修改数据库参数remote_listener,如下:
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
remote_listener string scan01:1521
变更后如下:
SQL> alter system set remote_listener=‘scan02:1521‘ scope=spfile;
SQL> show parameter remote_listener
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
remote_listener string scan02:1521
注意:在安装过程中,已将public主机名和private主机名写入OCR中,安装完成后不可修改。解决的办法是删除节点,变更主机名后,再重新加入RAC中即可。
原文地址:https://blog.51cto.com/candon123/2438277
时间: 2024-11-23 09:45:27