其他分享
首页 > 其他分享> > RAC修改IP(public/virtual/scan)

RAC修改IP(public/virtual/scan)

作者:互联网

在这里插入图片描述
使用oifcfg getif查看当前接口配置信息

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/oifcfg getif
ens33  192.168.168.0  global  public
ens38  3.3.3.0  global  cluster_interconnect

使用oifcfg工具修改Clusterware公共IP地址
删除公共网络接口:

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/oifcfg delif -global ens33

重新设置公共网络接口

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/oifcfg setif -global ens33/192.168.31.0:public

查看网络接口配置

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/oifcfg getif
ens38  3.3.3.0  global  cluster_interconnect
ens33  192.168.31.0  global  public

停止2个节点的集群服务

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl stop crs
[root@rac02 ~]# /u01/app/11.2.0.4/grid/bin/crsctl stop crs

关闭集群自启动

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl disable crs
[root@rac02 ~]# /u01/app/11.2.0.4/grid/bin/crsctl disable crs

修改网卡文件地址
编辑/etc/sysconfig/network-scripts/ifcfg-ens33,修改IP地址
修改后,在两个节点上执行命令:systemctl restart network重启网络服务。
修改host文件
将新的ip信息更新到两个节点的hosts文件

#PUBLIC IP
192.168.31.31   rac01
192.168.31.32   rac02

#VIRTUAL IP
192.168.31.33   rac01-vip
192.168.31.34   rac02-vip

#PRIVATE IP
3.3.3.1   rac01-priv
3.3.3.2   rac02-priv

#SCAN IP
192.168.31.35   rac-scan

启动2个节点的集群服务

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl start crs
[root@rac02 ~]# /u01/app/11.2.0.4/grid/bin/crsctl start crs

修改network网络资源配置
因为所有资源都依赖于network资源,所有必需先修改。
查看当前network的网络配置信息:

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl config network
Network exists: 1/192.168.168.0/255.255.255.0/ens33, type static

修改network网络资源配置(一个节点改就可以):

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl modify network -k 1 -S 192.168.31.0/255.255.255.0/ens33 -v
Successfully modified Network. 
[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl config network
Network exists: 1/192.168.31.0/255.255.255.0/ens33, type static

重新配置SCAN
由于SCAN VIPSCAN Listener与公共网络相关,所以必需一并修改。
查看当前SCAN VIPSCAN Listener配置信息:

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.31.0/255.255.255.0/ens33
SCAN VIP name: scan1, IP: /rac-scan/192.168.168.35
SCAN VIP name: scan2, IP: /rac-scan/192.168.168.36

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521

停止SCAN VIPSCAN Listener

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl stop scan_listener
[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl stop scan

删除SCAN VIPSCAN Listener

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl remove scan_listener
Remove scan listener? (y/[n]) y

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl remove scan
Remove the scan? (y/[n]) y

配置SCAN VIPSCAN Listener

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl add scan -n rac-scan -k 1 -S 192.168.31.0/255.255.255.0/ens33
[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl add scan_listener

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.31.0/255.255.255.0/ens33
SCAN VIP name: scan1, IP: /rac-scan/192.168.31.35

启动SCAN VIPSCAN Listener

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl start scan
[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl start scan_listener

检查SCANSCAN Listener运行状态

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac01

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac01

重新配置VIP和本地Listener
由于VIP和本地Listener与公共网络相关,所以必需一并修改。
停止VIP资源和本地监听程序:

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl stop resource ora.rac01.vip -f
CRS-2673: Attempting to stop 'ora.rac01.vip' on 'rac01'
CRS-2677: Stop of 'ora.rac01.vip' on 'rac01' succeeded

[root@rac02 ~]# /u01/app/11.2.0.4/grid/bin/crsctl stop resource ora.rac02.vip -f
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac02'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.rac02.vip' on 'rac02'
CRS-2677: Stop of 'ora.rac02.vip' on 'rac02' succeeded

修改VIP资源IP地址:

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl modify nodeapps -A 192.168.31.33/255.255.255.0/ens33 -n rac01
[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl modify nodeapps -A 192.168.31.34/255.255.255.0/ens33 -n rac02

启动VIP资源:

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl start resource ora.rac01.vip -f
CRS-2672: Attempting to start 'ora.rac01.vip' on 'rac01'
CRS-2676: Start of 'ora.rac01.vip' on 'rac01' succeeded

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl start resource ora.rac02.vip -f
CRS-2672: Attempting to start 'ora.rac02.vip' on 'rac02'
CRS-2676: Start of 'ora.rac02.vip' on 'rac02' succeeded

启动监听:

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/srvctl start listener

检查数据库参数
local_listener参数配置向本地监听程序动态注册VIP,目前VIP地址已经修改,如果local_listener参数没有相应的改变的话,会导致数据库不能动态注册带监听程序上。
连接数据库,查看local_listener

SQL> show parameter local_listener

NAME				     TYPE			       VALUE
------------------------------------ --------------------------------- ------------------------------
local_listener			     string
SQL> alter system set local_listener = '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.31.33)(PORT=1521))))' scope = both;

System altered.

SQL> show parameter local_listener

NAME				     TYPE			       VALUE
------------------------------------ --------------------------------- ------------------------------
local_listener			     string			       (DESCRIPTION=(ADDRESS_LIST=(AD
								       DRESS=(PROTOCOL=TCP)(HOST=192.
								       168.31.33)(PORT=1521))))

二节点同样需要检查

2.13 开启集群自启动

[root@rac01 ~]# /u01/app/11.2.0.4/grid/bin/crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@rac02 ~]# /u01/app/11.2.0.4/grid/bin/crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.

检查集群状态

[grid@rac01 ~]$ crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARC.dg
               ONLINE  ONLINE       rac01                                        
               ONLINE  ONLINE       rac02                                        
ora.DAT.dg
               ONLINE  ONLINE       rac01                                        
               ONLINE  ONLINE       rac02                                        
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac01                                        
               ONLINE  ONLINE       rac02                                        
ora.OCR.dg
               ONLINE  ONLINE       rac01                                        
               ONLINE  ONLINE       rac02                                        
ora.asm
               ONLINE  ONLINE       rac01                    Started             
               ONLINE  ONLINE       rac02                    Started             
ora.gsd
               OFFLINE OFFLINE      rac01                                        
               OFFLINE OFFLINE      rac02                                        
ora.net1.network
               ONLINE  ONLINE       rac01                                        
               ONLINE  ONLINE       rac02                                        
ora.ons
               ONLINE  ONLINE       rac01                                        
               ONLINE  ONLINE       rac02                                        
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac01                                        
ora.cvu
      1        ONLINE  ONLINE       rac01                                        
ora.oc4j
      1        ONLINE  ONLINE       rac01                                        
ora.rac.db
      1        ONLINE  ONLINE       rac01                    Open                
      2        ONLINE  ONLINE       rac02                    Open                
ora.rac01.vip
      1        ONLINE  ONLINE       rac01                                        
ora.rac02.vip
      1        ONLINE  ONLINE       rac02                                        
ora.scan1.vip
      1        ONLINE  ONLINE       rac01        

标签:bin,RAC,scan,IP,app,11.2,rac01,grid,ONLINE
来源: https://blog.csdn.net/sudahai102448567/article/details/122395484