Skip to content

Change Only Private IP for 11gR2 RAC

November 7, 2013

Case I. Changing private hostname
===========================================
In pre-11.2 Oracle Clusterware, private hostname is recorded in OCR, it can not be updated. Generally private hostname is not required to change. Its associated IP can be changed.

The only way to change private hostname is by deleting/adding nodes, or reinstall Oracle Clusterware.

In 11.2 Grid Infrastructure, private hostname is no longer recorded in OCR and there is no dependancy on the private hostname.
It can be changed freely in /etc/hosts.

Case II. Changing private IP only without changing network interface, subnet and netmask
=================================================================
We would only change the private IP
——————————————————
From : Node2 Priv_IP :192.168.5.1 Net Mask : 255.255.0.0
To     : Node2 Priv_IP :192.168.8.1 Net Mask : 255.255.0.0

As we see above there is no major change as such. It’s only the IP getting changed and not the Netmask or interface,
so change would be straight forward as below.

(a)Simply shutdown Oracle Clusterware stack on the node where change required,
(b)Make IP modification at OS layer (eg: /etc/hosts, OS network config etc) for private network,
(c)Restart Oracle Clusterware stack will complete the task.

Current Private IP details :
——————————————–
mgracsolsrv64bit2:[root]$ cat /etc/hosts

#PRIVATE
192.168.5.1  mgracsolsrv64bit1-priv mgracsolsrv64bit1-priv.mgdom.com
192.168.5.2  mgracsolsrv64bit2-priv mgracsolsrv64bit2-priv.mgdom.com
————————————————————————————————

mgracsolsrv64bit2:/export/home/grid: olsnodes -n -i -l -p
mgracsolsrv64bit2       1       192.168.5.2     mgracsolsrv64bit2-vip

mgracsolsrv64bit2:/export/home/grid: oifcfg getif
e1000g0  192.168.56.0  global  public
e1000g1  192.168.0.0  global  cluster_interconnect

mgracsolsrv64bit2:/export/home/grid: oifcfg iflist -p -n
e1000g0  192.168.56.0  PUBLIC  255.255.255.0
e1000g1  192.168.0.0  PUBLIC  255.255.0.0
e1000g2  192.168.56.0  PUBLIC  255.255.255.0

mgracsolsrv64bit2:/export/home/grid: netstat -i
Name  Mtu  Net/Dest      Address        Ipkts  Ierrs Opkts  Oerrs Collis Queue
lo0   8232 loopback      localhost      6983   0     6983   0     0      0
e1000g0 1500 mgracsolsrv64bit2 mgracsolsrv64bit2 1434   0     1083   0     0      0
e1000g1 1500 mgracsolsrv64bit2-priv mgracsolsrv64bit2-priv 15886  0     11124  0     0      0

mgracsolsrv64bit2:/export/home/grid: netstat -in
Name  Mtu  Net/Dest      Address        Ipkts  Ierrs Opkts  Oerrs Collis Queue
lo0   8232 127.0.0.0     127.0.0.1      7067   0     7067   0     0      0
e1000g0 1500 192.168.56.0  192.168.56.21  1440   0     1093   0     0      0
e1000g1 1500 192.168.0.0   192.168.5.2    16177  0     11320  0     0      0

JFYI
=========
Generally Choose a private IP address that is in the address range 10.*.*.* or 192.168.*.*
=================================================================================================
Private     10.0.0.1     Hosts file
Private     10.0.0.2     Hosts file

Class A: 10.0.0.0 to 10.255.255.255
Class B: 172.16.0.0 to 172.31.255.255
Class C: 192.168.0.0 to 192.168.255.255
=================================================================================================

1) Stop CRS as root

/u01/app/11.2.0.1/grid/bin/crsctl stop crs

2) Backup /u01/app/11.2.0.1/grid/gpnp/<hostname>/profiles/peer/profile.xml

ls -lh /u01/app/11.2.0.1/grid/gpnp/`hostname`/profiles/peer/profile.xml
-rw-r–r–   1 grid     oinstall    1.8K Oct 30 12:50 /u01/app/11.2.0.1/grid/gpnp/mgracsolsrv64bit2/profiles/peer/profile.xml

cd /u01/app/11.2.0.1/grid/gpnp/mgracsolsrv64bit2/profiles/peer/
ls -lthr
cp -pr profile.xml profile.xml.bkp.1

Profile.xml contains interface name and respective SubnetID
————————————————————————————
…..
<gpnp:Network-Profile>
<gpnp:HostNetwork id=”gen” HostName=”*”>
<gpnp:Network id=”net1″ IP=”192.168.56.0″ Adapter=”e1000g0″ Use=”public”/>
<gpnp:Network id=”net2″ IP=”192.168.0.0″ Adapter=”e1000g1″ Use=”cluster_interconnect”/>
…..

3) Change the IP in below OS files as root

(i) /etc/hosts (both nodes)

(ii) /etc/hostname.<interfaces>

netstat -i|grep priv |awk ‘{print $1 ” ”  $4}’
e1000g1 mgracsolsrv64bit1-priv

netstat -in |grep e1000g1  |awk ‘{print $1 ” ”  $4}’
e1000g1 192.168.5.1

/etc/hostname.<interfaces>

mgracsolsrv64bit2:[root]$ ls -ltr /etc/hostname.*
-rw-r–r–   1 root     root          39 Oct 27 18:22 /etc/hostname.e1000g0
-rw-r–r–   1 root     root          34 Oct 27 18:22 /etc/hostname.e1000g1

mgracsolsrv64bit2:[root]$ cat /etc/hostname.e1000g1
192.168.05.02 netmask 255.255.0.0

vi /etc/hosts
vi /etc/hostname.e1000g1

mgracsolsrv64bit2:/export/home/grid: cat /etc/hostname.e1000g1
192.168.8.2 netmask 255.255.0.0

4) Check current IP and its interface

$ ifconfig -a |sed -n -e ‘/e1000g1/,/broadcast/p’

e1000g1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 192.168.5.2 netmask ffff0000 broadcast 192.168.255.255

$ netstat -in |egrep ‘Name|e1000g1’ |awk ‘{print $1 ” ” $3 ” ” $4}’
Name Net/Dest Address
e1000g1 192.168.0.0 192.168.5.2

5) To Change the IP Address for the current Session as root:

$ ifconfig e1000g1 192.168.8.2 netmask 255.255.0.0 broadcast + up

mgracsolsrv64bit2:[root]$ ifconfig e1000g1 192.168.8.2 netmask 255.255.0.0 broadcast + up

mgracsolsrv64bit2:[root]$ ifconfig -a |sed -n -e ‘/e1000g1/,/broadcast/p’
e1000g1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 192.168.8.2 netmask ffff0000 broadcast 192.168.255.255

mgracsolsrv64bit2:[root]$ netstat -in |egrep ‘Name|e1000g1’ |awk ‘{print $1 ” ” $3 ” ” $4}’
Name Net/Dest Address
e1000g1 192.168.0.0 192.168.8.2

6) SSH/Ping from Both Nodes

ssh 192.168.8.2  (both nodes)

mgracsolsrv64bit1:/export/home/grid: ping -s 192.168.8.2 1 2
PING 192.168.8.2: 1 data bytes
9 bytes from mgracsolsrv64bit2-priv (192.168.8.2): icmp_seq=0.
9 bytes from mgracsolsrv64bit2-priv (192.168.8.2): icmp_seq=1.

—-192.168.8.2 PING Statistics—-
2 packets transmitted, 2 packets received, 0% packet loss

7) Start CRS as root
/u01/app/11.2.0.1/grid/bin/crsctl start crs

/u01/app/11.2.0.1/grid/bin/crsctl stat res -t
/u01/app/11.2.0.1/grid/bin/crsctl check crs
/u01/app/11.2.0.1/grid/bin/crsctl check cluster -all

8) Check if cluster returns the New/Modified  Priv IP

The olsnodes command provides the list of nodes and other information for all nodes participating in the cluster.
olsnodes quickly check that your cluster is operational, and all nodes are registered as members of the cluster.

mgracsolsrv64bit2:/export/home/grid: olsnodes -n -i -l -p
mgracsolsrv64bit2       2       192.168.8.2     mgracsolsrv64bit2-vip

Extra Info:
==============================================================================================================
Profile.xml is updated Whenever changes are made to a cluster with configuration tools like

oifcfg (Change network),
crsctl (change location of voting disk),
asmcmd (change ASM_DISKSTRING, SPfile location) etc.

To find the location of ASM spfile if the ASM is down

cd /u01/app/11.2.0.1/grid/gpnp/mgracsolsrv64bit1/profiles/peer

gpnptool getpval -asm_spf
To find GPnP Deamons are running on the local node
mgracsolsrv64bit2:/export/home/grid: gpnptool lfind
Success. Local gpnpd found.

Advertisements

From → RAC

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: