Oracle 11g RAC 修改各类IP地址(3)

5.2 修改VIP
需要停止数据库、监听和VIP,如果按照之前操作,目前数据库和监听已经是停止状态。

[grid@jyrac1 ~]$ srvctl stop vip -n jyrac1 [grid@jyrac1 ~]$ srvctl stop vip -n jyrac2

查看VIP当前设置:

[grid@jyrac1 ~]$ olsnodes -s jyrac1 Active jyrac2 Active [grid@jyrac1 ~]$ srvctl config vip -n jyrac1 VIP exists: /jyrac1-vip/192.168.1.51/192.168.56.0/255.255.255.0/eth2, hosting node jyrac1 [grid@jyrac1 ~]$ srvctl config vip -n jyrac2 VIP exists: /jyrac2-vip/192.168.1.53/192.168.56.0/255.255.255.0/eth2, hosting node jyrac2

修改VIP设置:

[root@jyrac1 ~]# /opt/app/11.2.0/grid/bin/srvctl modify nodeapps -n jyrac1 -A 192.168.1.51/255.255.255.0/eth2 [root@jyrac1 ~]# /opt/app/11.2.0/grid/bin/srvctl modify nodeapps -n jyrac2 -A 192.168.1.53/255.255.255.0/eth2

再次验证VIP修改完成:

[root@jyrac1 ~]# /opt/app/11.2.0/grid/bin/srvctl config vip -n jyrac1 VIP exists: /jyrac1-vip/192.168.1.51/192.168.1.0/255.255.255.0/eth2, hosting node jyrac1 [root@jyrac1 ~]# /opt/app/11.2.0/grid/bin/srvctl config vip -n jyrac2 VIP exists: /jyrac2-vip/192.168.1.53/192.168.1.0/255.255.255.0/eth2, hosting node jyrac2

启动vip

[grid@jyrac1 ~]$ srvctl start vip -n jyrac1 [grid@jyrac1 ~]$ srvctl start vip -n jyrac2

启动监听:

[grid@jyrac1 ~]$ srvctl start listener

启动数据库:

[grid@jyrac1 ~]$ srvctl start database -d jyzhao

确认local_listener信息:
检查local_listener信息,如果不正确需要修改,我这里查询是正确的。

--两个节点分别确认: show parameter local_listener --修改: alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.51)(PORT=1521))' sid='jyzhao1'; alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.53)(PORT=1521))' sid='jyzhao2';

5.3 修改SCAN VIP
查看SCAN VIP当前设置:

[grid@jyrac1 ~]$ srvctl config scan SCAN name: jyrac-scan, Network: 1/192.168.1.0/255.255.255.0/eth2 SCAN VIP name: scan1, IP: /jyrac-scan/192.168.56.160

停止scan_listener和scan资源

[grid@jyrac1 ~]$ srvctl stop scan_listener [grid@jyrac1 ~]$ srvctl stop scan --确认已停止 [grid@jyrac1 ~]$ srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is not running [grid@jyrac1 ~]$ srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is not running

使用root用户修改SCAN VIP

[root@jyrac1 ~]# /opt/app/11.2.0/grid/bin/srvctl modify scan -n jyrac-scan 注意:root用户执行修改,且确认/etc/hosts映射关系已修改为新的scan VIP。

修改并启动资源

[grid@jyrac1 ~]$ srvctl modify scan_listener -u [grid@jyrac1 ~]$ srvctl start scan_listener 注意:执行后确认scan_listener和scan都已经启动。

确认修改成功

[grid@jyrac1 ~]$ srvctl config scan SCAN name: jyrac-scan, Network: 1/192.168.1.0/255.255.255.0/eth2 SCAN VIP name: scan1, IP: /jyrac-scan/192.168.1.60 [grid@jyrac1 ~]$ srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

查看整个集群状态正常:

[grid@jyrac1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA1.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.FRA1.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.LISTENER.lsnr ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.OCR1.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.asm ONLINE ONLINE jyrac1 Started ONLINE ONLINE jyrac2 Started ora.gsd OFFLINE OFFLINE jyrac1 OFFLINE OFFLINE jyrac2 ora.net1.network ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.ons ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.registry.acfs ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE jyrac1 ora.cvu 1 ONLINE ONLINE jyrac2 ora.jyrac1.vip 1 ONLINE ONLINE jyrac1 ora.jyrac2.vip 1 ONLINE ONLINE jyrac2 ora.jyzhao.db 1 ONLINE ONLINE jyrac1 Open 2 ONLINE ONLINE jyrac2 Open ora.oc4j 1 ONLINE ONLINE jyrac1 ora.scan1.vip 1 ONLINE ONLINE jyrac1

至此,修改Oracle 11g RAC的public IP、VIP、SCAN VIP就算完成了。

6.修改Private IP

因为很少会遇到修改Private IP的需求,所以将其独立成一节。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/fea8d83bec79a9318605727ac82bbf42.html