通过虚拟机来实验修改IP。
现在/etc/hosts11.11.11.10 grid111.11.11.11 grid2
192.168.1.10 grid1-priv192.168.1.11 grid2-priv
11.11.11.14 grid1-vip11.11.11.15 grid2-vip
11.11.11.17 grid-scan
新的/etc/hosts
11.11.11.50 grid111.11.11.51 grid2
192.168.1.50 grid1-priv192.168.1.51 grid2-priv
11.11.11.54 grid1-vip11.11.11.55 grid2-vip
11.11.11.57 grid-scan
修改/etc/sysconfig/network-scripts/ifcfg-eth*
建议按照0.1,2,3的顺利来修改
0.disable resource
禁止所有节点自动启动并关闭两边节点数据库、监听 [grid]srvctl disable listener [grid]srvctl stop listener [grid]srvctl disable database -d racdb [grid]srvctl stop database -d racdb -o immediate 禁止所有节点自动启动并停止VIP [root]srvctl disable vip -i grdi1-vip [root]srvctl disable vip -i grid2-vip [grid]$ srvctl stop vip -n grid1 [grid]$ srvctl stop vip -n grid2 禁止所有节点的SCAN_LISTENER的启动,停止所有节点的SCAN_LISTENER [grid]$ srvctl disable scan_listener [grid]$ srvctl stop scan_listener 禁止所有节点的SCAN的启动,停止所有节点的SCAN [root]#srvctl disable scan [grid]$ srvctl stop scan 停止crs //两个节点都要执行 [root]#crsctl stop crs [root]#crsctl stop crs
1.修改public IP修改之前不要重启网卡,(在实验时发生了节点重启)
oifcfgdelif -global [/]#oifcfgsetif -global /:public#oifcfg getif#oifcfg delif -global eth0#oifcfg getif#oifcfg setif -global eth0/11.11.11.0:public(这里其实不用进行修改,因为在一个网段里)#oifcfg getif
2.修改private IP
$ oifcfg setif -global/:cluster_interconnect私有IP必须先添加setif新的privateIP,再delif原来的privateIP.否则:oifcfgdelif -global eth1/192.168.1.0PRIF-31:Failed to delete the specified network interface because it is thelast private interface#oifcfggetif#oifcfgsetif -global eth1/192.168.2.0:cluster_interconnect#oifcfgdelif -global eth1/192.168.1.0#oifcfggetif
3.修改VIP和SCAN-IP重启网卡,并修改/etc/hosts,如果不重启网卡:srvctl modify nodeapps -n grid1 -A192.168.0.50/255.255.255.0/eth0PRCN-2070 : Failed to validate network. No interface onlocalnode matches required network (subnet: 192.168.0.0, netmask:255.255.255.0 adapters: eth0).#service network restart
[root@grid1 grid1]# srvctl confignodeapps# srvctl modifynodeapps -n -A //<[if1[if2…]]>[root@grid1 grid1]# srvctl modify nodeapps -n grid1 -A11.11.11.54/255.255.255.0/eth0[root@grid1 grid1]# srvctl modify nodeapps -n grid2 -A11.11.11.55/255.255.255.0/eth0[root@grid1 grid1]# srvctl confignodeapps
SCAN-VIP[root@grid1 grid1]#srvctl modify scan -n11.11.11.57
4.enable resource#srvctl disable listener#srvctl disable scan_listener#srvctl disable scan#srvctl disable database -d orcl#srvctl disable vip -i grid1#srvctl disable vip -i grid2
5.重新启动#crsctl stop crs#crsctl start crs