操作系统版本 : OEL6.5 x64
数据库版本 : Oracle 11.2.0.4 x64 RAC
本文针对oracle 11.2.0.4 x64 for OEL6.5上的publiic/private/VIP/scan ip地址更改过程。详细修改过程如下,如在生产环境中修改需要反复测试后操作。2014.9.30通过本文方式两例Linux 11.2.0.3 RAC修改PUBLIC ,SCAN IP地址成功。
原IP地址
192.168.10.201 node1
192.168.10.202 node2
192.168.10.203 node1-vip
192.168.10.204 node2-vip
10.10.10.10 node1-priv
10.10.10.20 node2-priv
192.168.10.200 scan-cluster
调整后IP地址
192.168.76.211 node1
192.168.76.212 node2
192.168.76.213 node1-vip
192.168.76.214 node2-vip
20.20.20.20 node1-priv
20.20.20.21 node2-priv
192.168.76.210 scan-cluster
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl disable listener
# ./srvctl stop listener
# ./srvctl disable database -d orcl
# ./srvctl stop database -d orcl -o immediate
# ./srvctl disable vip -i "node1-vip"
# ./srvctl disable vip -i "node2-vip"
# ./srvctl stop vip -n node1
# ./srvctl stop vip -n node2
# ./srvctl disable scan_listener
# ./srvctl stop scan_listener
# ./srvctl disable scan
# ./srvctl stop scan
192.168.76.211 node1
192.168.76.212 node2
192.168.76.213 node1-vip
192.168.76.214 node2-vip
20.20.20.20 node1-priv
20.20.20.21 node2-priv
192.168.76.210 scan-cluster
node1节点
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=192.168.76.211
NETMASK=255.255.255.0
GATEWAY=192.168.76.2
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
node2节点
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=192.168.76.212
NETMASK=255.255.255.0
GATEWAY=192.168.76.2
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
过一会儿,通过crs_stat -t进行查看.
# 获取集群IP地址配置,如果修改的IP地址只是同一个网段,下面不需要修改.
# ./oifcfg getif
bond0 192.168.10.0 global public
bond1 10.10.10.0 global cluster_interconnect
# ./oifcfg delif -global bond0
# ./oifcfg setif -global bond0/192.168.76.0:public
# ./oifcfg getif
bond1 10.10.10.0 global cluster_interconnect
bond0 192.168.76.0 global public
# 注: 11.2.0.2以上版本RAC,需要修改network网络资源
# 查看当前network配置
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl config network
网络存在: 1/192.168.10.0/255.255.255.0/bond0, 类型 static
可以看到网络资源还是原来的IP地址信息,需要修改.
# ./srvctl modify network -k 1 -S 192.168.76.0/255.255.255.0/eth0 -v
# 说明:-k指定的是network number,exists后面的数字。-S 指定新的子网地址/新的子网掩码/新接口。
# ./srvctl config network
网络存在: 1/192.168.76.0/255.255.255.0/bond0, 类型 static
说明: 通过Private IP地址是私有IP地址,通过VLAN进行隔离,是不需要进行修改的,除非有特别的要求必须要修改。
如果不需要修改,这一节的内容可以跳过。
# ./oifcfg getif
bond1 10.10.10.0 global cluster_interconnect
bond0 192.168.76.0 global public
直接删除掉,删除不了,必须要先添加新的,然后再删除旧的内容。
# ./oifcfg delif -global bond1
PRIF-31: Failed to delete the specified network interface because it is the last private interface
# ./oifcfg setif -global bond1/20.20.20.0:cluster_interconnect
# ./oifcfg getif
bond1 10.10.10.0 global cluster_interconnect
bond0 192.168.76.0 global public
bond1 20.20.20.0 global cluster_interconnect
# ./oifcfg delif -global bond1/10.10.10.0:cluster_interconnect
# ./oifcfg getif
bond0 192.168.76.0 global public
bond1 20.20.20.0 global cluster_interconnect
说明:PrivateIP必须要先修改然后再修改网卡的IP地址。
node1节点
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
BOOTPROTO=none
IPADDR=20.20.20.20
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
node2节点
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
BOOTPROTO=none
IPADDR=20.20.20.21
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl config vip -n node1
VIP 存在: /node1-vip/192.168.76.213/192.168.10.0/255.255.255.0/bond0, 托管节点 node1
# ./srvctl modify nodeapps -n node1 -A 192.168.76.213/255.255.255.0/bond0
# ./srvctl modify nodeapps -n node2 -A 192.168.76.214/255.255.255.0/bond0
# ./srvctl config vip -n node1
VIP 存在: /node1-vip/192.168.76.213/192.168.76.0/255.255.255.0/bond0, 托管节点 node1
# ./srvctl config vip -n node2
VIP 存在: /node2-vip/192.168.76.214/192.168.76.0/255.255.255.0/bond0, 托管节点 node2
# ./srvctl config scan
SCAN 名称: scan-cluster, 网络: 1/192.168.76.0/255.255.255.0/bond0
SCAN VIP 名称: scan1, IP: /scan-cluster/192.168.10.200
# ./srvctl modify scan -n 192.168.76.210
# ./srvctl config scan
SCAN 名称: 192.168.76.210, 网络: 1/192.168.76.0/255.255.255.0/bond0
SCAN VIP 名称: scan1, IP: /192.168.76.210/192.168.76.210
节点1上操作
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl enable listener
# ./srvctl enable vip -i "node1-vip"
# ./srvctl enable vip -i "node2-vip"
# ./srvctl enable scan_listener
# ./srvctl enable scan
# ./srvctl enable database -d orcl
# ./srvctl start listener
# ./srvctl start scan_listener
# ./srvctl start scan
# ./srvctl start database -d orcl