11g RAC集群修改IP地址

当前IP地址配置:
#rac1
192.168.162.15      rac1
192.168.162.115     rac1-vip
10.10.10.11         rac1-priv

#rac2
192.168.162.16      rac2
192.168.162.116     rac2-vip
10.10.10.12         rac2-priv

#scan-ip
192.168.162.17      scan-cluster

修改后IP地址配置:
#rac1
192.168.162.10      rac1
192.168.162.11      rac1-vip
10.10.10.11         rac1-priv

#rac2
192.168.162.12      rac2
192.168.162.13      rac2-vip
10.10.10.12         rac2-priv

#scan-ip
192.168.162.14      scan-cluster


一、关闭集群数据库:
[oracle@rac1 ~]$ srvctl stop database -d racdb

二、修改public ip:
1.查看集群ip:
[root@rac1 ~]# oifcfg getif
eth0  192.168.162.0  global  public
eth1  10.10.10.0  global  cluster_interconnect

2.删除旧网卡配置:
[root@rac1 ~]# oifcfg delif -global eth0
[root@rac1 ~]# oifcfg getif
eth1  10.10.10.0  global  cluster_interconnect

3.重新设置新的公网ip:
[root@rac1 ~]# oifcfg setif -global eth0/192.168.162.0:public
[root@rac1 ~]# oifcfg getif
eth1  10.10.10.0  global  cluster_interconnect
eth0  192.168.162.0  global  public
[root@rac2 ~]# oifcfg getif
eth1  10.10.10.0  global  cluster_interconnect
eth0  192.168.162.0  global  public

4.停止集群:
[root@rac1 ~]# crsctl stop crs
[root@rac2 ~]# crsctl stop crs

5.修改公网ip地址:
[root@rac1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=2e5736c0-2155-43f6-abc8-eb7152e8da1d
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
HWADDR=00:50:56:23:A9:13
IPADDR=192.168.162.10
PREFIX=24
GATEWAY=192.168.162.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"

[root@rac2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=42faf68c-5fc6-4584-beb3-10488cf63707
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
HWADDR=00:50:56:39:52:22
IPADDR=192.168.162.11
PREFIX=24
GATEWAY=192.168.162.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"

[root@rac1 ~]# ifdown eth0 && ifup eth0
[root@rac2 ~]# ifdown eth0 && ifup eth0

6.启动集群
修改后集群起不来,重启后集群恢复正常
[root@rac1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG1.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.DATADG2.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.DATADG3.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.FRADG.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.SYSTEMDG.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.asm
               ONLINE  ONLINE       rac1                     Started
               ONLINE  ONLINE       rac2                     Started
ora.gsd
               OFFLINE OFFLINE      rac1
               OFFLINE OFFLINE      rac2
ora.net1.network
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.ons
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac2
ora.cvu
      1        ONLINE  ONLINE       rac2
ora.oc4j
      1        ONLINE  ONLINE       rac2
ora.rac1.vip
      1        ONLINE  ONLINE       rac1
ora.rac2.vip
      1        ONLINE  ONLINE       rac2
ora.racdb.db
      1        OFFLINE OFFLINE                               Instance Shutdown
      2        OFFLINE OFFLINE                               Instance Shutdown
ora.scan1.vip
      1        ONLINE  ONLINE       rac2

[root@rac1 ~]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

[root@rac2 ~]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

三、修改vip:
1.查看当前vip配置信息:
[root@rac1 ~]# srvctl config nodeapps -a
网络存在: 1/192.168.162.0/255.255.255.0/eth0, 类型 static
VIP 存在: /rac1-vip/192.168.162.11/192.168.162.0/255.255.255.0/eth0, 托管节点 rac1
VIP 存在: /rac2-vip/192.168.162.13/192.168.162.0/255.255.255.0/eth0, 托管节点 rac2

[root@rac2 ~]# srvctl config nodeapps -a
网络存在: 1/192.168.162.0/255.255.255.0/eth0, 类型 static
VIP 存在: /rac1-vip/192.168.162.11/192.168.162.0/255.255.255.0/eth0, 托管节点 rac1
VIP 存在: /rac2-vip/192.168.162.13/192.168.162.0/255.255.255.0/eth0, 托管节点 rac2

2.停止监听:
[root@rac1 ~]# srvctl stop listener
[root@rac1 ~]# srvctl status listener
监听程序 LISTENER 已启用
监听程序 LISTENER 未运行
[root@rac2 ~]# srvctl status listener
监听程序 LISTENER 已启用
监听程序 LISTENER 未运行

3.关闭vip:
[root@rac1 ~]# srvctl stop vip -n rac1
[root@rac1 ~]# srvctl stop vip -n rac2

4.修改vip配置:
[root@rac1 ~]# srvctl modify nodeapps -A 192.168.162.11/255.255.255.0/eth0 -n rac1
[root@rac1 ~]# srvctl modify nodeapps -A 192.168.162.13/255.255.255.0/eth0 -n rac2

5.启动vip:
[root@rac1 ~]# srvctl start vip -n rac1
[root@rac1 ~]# srvctl start vip -n rac2

四、修改scan ip:
1.查看scan配置
[root@rac1 ~]# srvctl config scan
SCAN 名称: scan-cluster, 网络: 1/192.168.162.0/255.255.255.0/eth0
SCAN VIP 名称: scan1, IP: /scan-cluster/192.168.162.17

2.关闭SCAN与SCAN Listener:
[root@rac1 ~]# srvctl stop scan_listener
[root@rac1 ~]# srvctl stop scan

3.修改SCAN配置:
[root@rac1 ~]# srvctl modify scan -n scan-cluster

4.启动SCAN与监听器:
[root@rac1 ~]# srvctl start scan
[root@rac1 ~]# srvctl start scan_listener

5.查看修改后的SCAN:
[root@rac1 ~]# srvctl config scan
SCAN 名称: scan-cluster, 网络: 1/192.168.162.0/255.255.255.0/eth0
SCAN VIP 名称: scan1, IP: /scan-cluster/192.168.162.14

  

posted @ 2022-04-16 00:12  orcl  阅读(267)  评论(0编辑  收藏  举报