一、修改IP前后对照表
调整前
主机名 类型 IP地址 网卡端口
rac01 public ip 192.168.0.141 eth0
rac02 public ip 192.168.0.142 eth0
rac01-priv private-ip 5.1.1.1 eth1
rac02-priv private-ip 5.1.1.2 eth1
rac01-vip vip 192.168.0.143
rac02-vip vip 192.168.0.144
rac-scan scanip 192.168.0.145
调整后
主机名 类型 IP地址 网卡端口
rac01 publicip 192.168.0.231 eth0
rac02 publicip 192.168.0.232 eth0
rac01-priv private-ip 5.1.1.1 eth1(不改)
rac02-priv private-ip 5.1.1.2 eth1(不改)
rac01-vip vip 192.168.0.233
rac02-vip vip 192.168.0.234
rac-scan scanip 192.168.0.235
二、停止crs及相关资源
2.1禁止所有节点自动启动并关闭两边节点数据库、监听
[grid@rac01~]srvctl disable listener
[grid@rac01~]srvctl stop listener //关监听
[grid@rac01~]srvctl disable database -d racdb //racdb是数据库名
[grid@rac01~]srvctl stop database -d racdb -o immediate //关数据库
2.2 禁止所有节点自动启动并停止VIP(名字要对应hosts)
[root@rac01~]/u01/app/11.2.0/grid/bin/srvctl disable vip -i "rac01-vip"
[root@rac01~]/u01/app/11.2.0/grid/bin/srvctl disable vip -i "rac02-vip"
[grid@rac01~]$ srvctl stop vip -n rac01
[grid@rac01~]$ srvctl stop vip -n rac02
2.3 禁止所有节点的SCAN_LISTENER的启动,停止所有节点的SCAN_LISTENER
[grid@rac01~]$ srvctl disable scan_listener
[grid@rac01~]$ srvctl stop scan_listener
2.4 禁止所有节点的SCAN的启动,停止所有节点的SCAN
[root@rac01 ~]#/u01/app/11.2.0/grid/bin/srvctl disable scan
[grid@rac01~]$ srvctl stop scan
2.5 停止crs //两个节点都要执行
[root@rac01 ~]#/u01/app/11.2.0/grid/bin/crsctl stop crs
[root@rac02 ~]#/u01/app/11.2.0/grid/bin/crsctl stop crs
三、修改publicip, vip,scan ip
3.1 修改两边的/etc/hosts文件
修改前最好做个备份
修改后如下
#PublicNetwork - (eth0)
192.168.0.231 rac01
192.168.0.232 rac02
#Private Network - (eth1)
5.1.1.1 rac01-priv rac01-priv
5.1.1.2 rac02-priv rac02-priv
#Public Virtual IP - (eth0:1)
192.168.0.233 rac01-vip rac01-vip
192.168.0.234 rac02-vip rac02-vip
# Single Client Access Name (SCAN)
192.168.0.235 rac-scan rac-scan
3.2 修改rac01及rac02网卡配置
(1)rac01:vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为192.168.0.231掩码255.255.255.0
service network restart//重启网卡
(2)rac02:vi/etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为192.168.0.232掩码 255.255.255.0
service network restart//重启网卡
3.3 两边节点启动crs
[root@rac01 ~]#/u01/app/11.2.0/grid/bin/crsctl start crs
[root@rac02 ~]#/u01/app/11.2.0/grid/bin/crsctl start crs
3.4 集群的public IP 设置(如果属于同一网段,可不修改)
start crs后,请稍等一会儿再执行
[root@rac01bin]# ./oifcfg getif //查看下集群的VIP
eth0 192.168.0.0 global public
eth1 5.1.1.0 global cluster_interconnect
[root@rac01bin]# ./oifcfg delif -global eth0
[root@rac01bin]# ./oifcfg setif -global eth0/192.168.5.0:public
[root@rac01/2bin]# ./oifcfg getif //两边查看下集群的VIP
这里是举例子,像我这次修改没有更改字段。所以我没有操作这一步。
如果需要修改private ip 则需要先用
[root@rac01bin]# ./oifcfg delif -global eth1
[root@rac01bin]#./oifcfg setif -global eth1/x.x.x.0:cluster_interconnect(注意,我前面修改网卡可没有修改private,private是要在这步先修改后,才可以修改的)
3.5 集群的VIP设置
[root@rac01bin]#./srvctl config vip -n rac01 //先查看集群的VIP
VIPexists.:rac01
VIP exists.:/rac01-vip/192.168.0.233/255.255.255.0/eth0
[root@rac01 bin]# ./srvctl modify nodeapps -n rac01 -A192.168.0.233/255.255.255.0/eth0
[root@rac01 bin]# ./srvctl modify nodeapps -n rac02 -A192.168.0.234/255.255.255.0/eth0
[root@rac01/2bin]#./srvctl config vip -n rac01 //两边检查集群的VIP
3.6 集群的SCANIP设置
[root@rac01bin]# ./srvctl config scan //先查看集群的SCAN IP
SCAN name:rac-scan, Network: 1/192.168.0.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /192.168.0.145/192.168.0.145
[root@rac01 bin]# ./srvctl modify scan -n 192.168.0.235
3.6.1如果需要修改private
(1)rac01:vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为15.1.1.1掩码255.255.255.0
service network restart//重启网卡
(2)rac02:vi/etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为15.1.1.2掩码 255.255.255.0
service network restart//重启网卡
3.7 启动VIP、监听、scan和scan_listener、数据库
[root@rac01 bin]#./srvctl enable listener
[root@rac01 bin]#./srvctl enable vip -i "rac01-vip"
[root@rac01 bin]# ./srvctl enable vip -i "rac02-vip"
[root@rac01 bin]# ./srvctl enable scan_listener
[root@rac01 bin]# ./srvctl enable scan
[root@rac01 bin]# ./srvctl enable database -d racdb
[root@rac01 bin]# ./srvctl start listener
[root@rac01bin]# ./srvctl start vip -n rac01,rac02
[root@rac01 bin]# ./srvctl start scan_listener
[root@rac01 bin]# ./srvctl start scan
[root@rac01 bin]# ./srvctl start database -d racdb