5.2 修改VIP
需要停止数据库、监听和VIP,如果按照之前操作,目前数据库和监听已经是停止状态。
查看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信息,如果不正确需要修改,我这里查询是正确的。
5.3 修改SCAN VIP
查看SCAN VIP当前设置:
停止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的需求,所以将其独立成一节。