oracle 11g RAC集群IP修改步骤:
1、操作系统:
CentOS 7.4
原IP信息:
#public IP
172.17.2.211 jq-hxdbt-211
172.17.2.212 jq-hxdbt-212
#private IP
172.17.5.211 jq-hxdbt-211-priv
172.17.5.212 jq-hxdbt-212-priv
#virtual IP:
172.17.2.213 jq-hxdbt-211-vip
172.17.2.214 jq-hxdbt-212-vip
#scan ip
172.17.2.215 hxdbscan
修改后:
#public IP
172.17.6.11 jq-hxdbt-11
172.17.6.12 jq-hxdbt-12
#private IP
172.17.7.213 jq-hxdbt-11-priv
172.17.7.214 jq-hxdbt-12-priv
#virtual IP:
172.17.6.13 jq-hxdbt-11-vip
172.17.6.14 jq-hxdbt-12-vip
#scan ip
172.17.6.15 hxdbscan
1、正常关闭数据库、监听和集群crs
这里先正常immediate关闭数据库,然后关闭监听,最后关闭两个节点的crs,这样再次启动crs时,就不会自动启动监听和数据库了。
节点1 grid执行即可。
[grid@jq-hxdbt-211 ~]$ srvctl stop database -d crmpos -o immediate
[grid@jq-hxdbt-211 ~]$ srvctl stop listener
[grid@jq-hxdbt-211 ~]$ which crsctl
/u01/app/11.2.0/grid/bin/crsctl
两个节点root都执行:
[root@jq-hxdbt-211 ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs
[root@jq-hxdbt-212 ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs
2.修改/etc/hosts配置文件
先备份原来的/etc/hosts文件为/etc/hosts.bak
[root@jq-hxdbt-211 ~]# cp /etc/hosts /etc/hosts.bak
[root@jq-hxdbt-212 ~]# cp /etc/hosts /etc/hosts.bak
然后再vi修改/etc/hosts文件:
将public ip、vip、scan vip修改为如下值:两个节点都改。
#public IP
172.17.6.11 jq-hxdbt-211
172.17.6.12 jq-hxdbt-212
#virtual IP:
172.17.6.13 jq-hxdbt-211-vip
172.17.6.14 jq-hxdbt-212-vip
#scan ip
172.17.6.15 hxdbscan
注意:其他内容不变。关于private ip,等后面单独修改private ip。
----------------
主机同学修改操作系统公有IP。修改网卡配置并重启。
-----------------
两个节点启动crscrsctl start crs
[root@jq-hxdbt-211 ~]# /u01/app/11.2.0/grid/bin/crsctl start crs
[root@jq-hxdbt-212 ~]# /u01/app/11.2.0/grid/bin/crsctl start crs
注意:这里如果是按照上面关闭crs的操作,正常数据库和监听是没有启动的,对应target和state都应该是offline。否则,得手工再关闭数据库和监听。
[root@jq-hxdbt-211 ~]# /u01/app/11.2.0/grid/bin/crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
crsctl stat res -t 查看状态
开始修改IP
- 修改Public IP
查看当前设定,两个节点root用户执行,
1节点执行
[root@jq-hxdbt-211 ~]# /u01/app/11.2.0/grid/bin/oifcfg getif
eth0 172.17.2.0 global public
eth1 172.17.5.0 global cluster_interconnect
删除旧值并设定新值
[root@jq-hxdbt-211 ~]# /u01/app/11.2.0/grid/bin/oifcfg delif -global eth0
[root@jq-hxdbt-211 ~]# /u01/app/11.2.0/grid/bin/oifcfg setif -global eth0/172.17.6.0:public
--查看验证修改成功:
[root@jq-hxdbt-211 ~]# /u01/app/11.2.0/grid/bin/oifcfg getif
eth1 172.17.5.0 global cluster_interconnect
eth0 172.17.6.0 global public
二节点执行
[root@jq-hxdbt-212 ~]# /u01/app/11.2.0/grid/bin/oifcfg delif -global eth0
[root@jq-hxdbt-212 ~]# /u01/app/11.2.0/grid/bin/oifcfg setif -global eth0/172.17.6.0:public