OracleRac跨网段修改Public IP/VIP/Private IP/Scan IP

本验证于测试环境,生产操作需谨慎

现为测试环境,机器有且仅有两个网卡存在,需求修改Public IP/VIP/Private IP/Scan IP,把Public IP/VIP/Scan IP的网段改为Private IP的网段,Private IP于Public IP网段互换。
先停掉两个节点的数据库

csharp 复制代码
#(ORACLE)
$ srvctl stop database -d <db_name>

操作前最好先备份两个节点的profile.xml文件

csharp 复制代码
#(GRID)
$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
$ cp -p profile.xml profile.xml.bk

用grid用户在一个节点上关闭监听

csharp 复制代码
#(GRID)
$ srvctl stop listener -n <hostname1>
$ srvctl stop listener -n <hostname2>
$ srvctl stop scan_listener

用grid用户在一节点关闭vip和scan vip

csharp 复制代码
#(GRID)
$ srvctl stop vip -n <hostname1>
$ srvctl stop vip -n <hostname2>
$ srvctl stop scan

用grid用户在一节点更改私公网和网通讯接口

csharp 复制代码
#(GRID)
$ oifcfg getif  --查看当前公网和网通讯接口

$ oifcfg  getifg
team1 20.8.91.0 global public
team2 16.0.100.0  global cluster_interconnect,asm
csharp 复制代码
#(GRID)
$ oifcfg setif -global <私有网卡名>/<新私有网段>:cluster_interconnect,asm

$ oifcfg setif -global team1/20.8.91.0 :cluster_interconnect,asm
$ oifcfg setif -global team2 /16.0.100.0  :public

grid用户登陆一节点配置新的priv子网

csharp 复制代码
#(GRID)
$ srvctl config listener -asmlistener
$ srvctl config asm  
--查看原ASMLISTENER

添加新的ASMLISTENER:

csharp 复制代码
#(GRID)
$ srvctl add listener -asmlistener -l ASMNET1LSNR2_ASM -subnet 20.8.91.0 

删除旧的ASMLISTENER:

csharp 复制代码
#(GRID)
$ lsnrctl stop ASMNET1LSNR_ASM
$ srvctl update listener -listener ASMNET1LSNR_ASM -asm -remove -force

root用户配置asmnetwork

csharp 复制代码
$(ROOT)
# srvctl config asmnetwork
# srvctl stop asmnetwork
# srvctl remove asmnetwork -netnum 1
# srvctl add asmnetwork -netnum 1 -subnet 20.8.91.0 

修改后关闭集群自启动并关闭集群

csharp 复制代码
$(ROOT)
# crsctl disable crs
# crsctl stop cluster -all

重启集群后root用户修改VIP资源为目标IP

csharp 复制代码
$(ROOT)
# srvctl modify nodeapps -n <hostname1> -A <hostname1-vip>/255.255.255.0/<网卡>
# srvctl modify nodeapps -n <hostname2> -A <hostname2-vip>/255.255.255.0/<网卡>
验证是否修改成功
# srvctl config vip -n <hostname1>
# srvctl config vip -n <hostname2>

修改scan IP

csharp 复制代码
$(ROOT)
# srvctl modify scan -n <scan-IP名>

#srvctl modify scan -n yysd-scan

#(GRID)
$ srvctl modify scan_listener -u
$ srvctl config scan
$ srvctl config scan_listener

用户grid登陆任一节点启动vip资源和scan vip资源

csharp 复制代码
#(GRID)
$ srvctl start vip -n <hostname1>
$ srvctl start vip -n <hostname2>
$ srvctl start scan
$ srvctl start listener -n <hostname1>
$ srvctl start listener -n <hostname2>
$ srvctl start scan_listener
相关推荐
笨蛋不要掉眼泪2 小时前
MySQL架构揭秘:慢查询日志详解
数据库·mysql·架构
pulinzt2 小时前
Tableau的基础使用
数据库·numpy
糖果店的幽灵3 小时前
【langgraph 从入门到精通graphApi 篇】LangGraphAPI 方式调用 - 初识与核心概念
数据库·人工智能·langgraph
TlSfoward3 小时前
TLSFOWARD TLS指纹
开发语言·数据库·爬虫·搜索引擎·https·php
️学习的小王3 小时前
MySQL 实战:从建表到索引管理的完整指南
数据库·mysql·oracle
宠友信息5 小时前
MySQL复合索引与Druid优化仿小红书源码个人主页查询链路
数据库·spring boot·websocket·mysql·uni-app
minji...5 小时前
MySQL数据库 (十九) MySQL图像化界面,MySQL连接池
数据库·mysql·navicat·mysql workbench·mysql连接池·数据库图形化界面
想躺平的小羊6 小时前
MySQL中LAST_DAY函数用法
数据库·mysql
光影6276 小时前
MySQL基础入门
数据库·笔记·sql·学习·mysql·学习方法
qetfw7 小时前
CentOS 7 搭建 MariaDB 数据库服务
linux·数据库·centos·mariadb