Tuesday, April 2, 2013

Changing Public IP, VIP and SCAN IP in 11gR2 RAC

The post list the steps for changing the public IP, VIP and SCAN IP. It must be mentioned that only the IPs are changed in this case. The subnet mask, the public and VIP interface all remain the same. Also private interconnect is not part of the change. Steps were tested on the 11gR2 RAC on RHEL 6
The IP change is as follows. The SCAN IP is set up in /etc/hosts (not supported by Oracle).
NameOld IPNew IP
rhel6m1192.168.0.85192.168.0.93
rhel6m2192.168.0.86192.168.0.94
rhel6m-scan192.168.0.91192.168.0.92
The steps could be done parallel (on all nodes) or in a rolling fashion on each node. Steps executed on one node is shown here and changes were done parallel on all nodes. Since the information modified is stored in OCR it is better to take a manual backup of the OCR before proceeding.
1. First step is to change the VIP configuration. Current VIP configuration is
srvctl config nodeapps
Network exists: 1/192.168.0.0/255.255.255.0/eth0, type static
VIP exists: /rhel6m1-vip/192.168.0.89/192.168.0.0/255.255.255.0/eth0, hosting node rhel6m1
VIP exists: /rhel6m2-vip/192.168.0.90/192.168.0.0/255.255.255.0/eth0, hosting node rhel6m2
2. Stop the database instance and the VIP resource
[oracle@rhel6m1 ~]$ srvctl stop instance -d std11g2 -i std11g21
[grid@rhel6m1 ~]$ srvctl stop vip -n `hostname -s` -f
3. Verify VIP resource is down by using ifconfig on the OS and using crsctl
crsctl stat res -t 

ora.rhel6m1.vip
      1        OFFLINE OFFLINE
ora.rhel6m2.vip
      1        OFFLINE OFFLINE
4. Add the new IP information to /etc/hosts (and DNS) and proceed to modifying the VIP. The modify command must be run as root user
[root@rhel6m1 grid]# srvctl modify nodeapps -n rhel6m1 -A 192.168.0.97/255.255.255.0/eth0
Verify that changes are taken effect
[grid@rhel6m2 ~]$ srvctl config nodeapps -a
Network exists: 1/192.168.0.0/255.255.255.0/eth0, type static
VIP exists: /rhel6m1-vip/192.168.0.97/192.168.0.0/255.255.255.0/eth0, hosting node rhel6m1
VIP exists: /rhel6m2-vip/192.168.0.98/192.168.0.0/255.255.255.0/eth0, hosting node rhel6m2
If the VIP is now on a different network then do not start VIP until public IP and SCAN IP is also changed into the same network.




5. Next is to update the SCAN IP information. Current SCAN IP configuration
srvctl config scan
SCAN name: rhel6m-scan, Network: 1/192.168.0.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rhel6m-scan/192.168.0.91
6. Stop the SCAN IP and the scan lister and verify it is stopped.
[root@rhel6m1 grid]# srvctl stop scan_listener

[root@rhel6m1 grid]# srvctl stop scan

[root@rhel6m1 grid]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running

[root@rhel6m1 grid]# srvctl status scan_listener
SCAN Listener MYLISTENER_SCAN1 is enabled
SCAN listener MYLISTENER_SCAN1 is not running
7. Modify the SCAN IP by executing the modify command as root user with the same SCAN name. (It is assumed that if DNS is used, the SCAN name now resolve to new IPs) This will pick up the new IP and update cluster records with the new SCAN IP.
[root@rhel6m1 grid]# srvctl modify scan -n rhel6m-scan
8. Verify the changes have taken effect
[root@rhel6m1 grid]# srvctl config scan
SCAN name: rhel6m-scan, Network: 1/192.168.0.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rhel6m-scan/192.168.0.92
If the SCAN IP is now on a different network than the public IP then don't start the SCAN IP until the pubilc IP is also changed.

9. Updating public IP requires no cluster related work. Shutdown the cluster stack
[root@rhel6m1 grid]# crsctl stop crs
10. Change IP address on OS (eg. editing ifcfg-eth*) files and restart the network for the changes to take effect. Once the IP changes are made it maybe worthwhile to do ssh between nodes using the new IP so it is added to known host list and no prompts are shown during the ssh between the nodes. As the final step restart the cluster stack with
# crsctl start crs
Useful metalink notes
How to update the IP address of the SCAN VIP resources (ora.scan.vip) [ID 952903.1]
Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node [ID 276434.1]
How to Modify Public Network Information including VIP in Oracle Clusterware [ID 276434.1]

Related Posts
Changing Listener and SCAN Listener Port in 11gR2 RAC
Changing Listener and SCAN Listener Name in 11gR2 RAC