Oracle rac 修改vip & scan ip

背景介绍:

现在有个需求,主机的物理机迁移,为了让业务改动最小,要修改新主库的VIP & SCAN IP,同网段的修改vip & scan比较简单

ps: 过段时间要修改物理机的网段,届时再更新!

修改vip

--修改前VIP & SCAN-IP

修改前vip最后两位为23、24

修改前scan-ip最后两位为25、20

--修改后VIP & SCAN-IP

修改后vip最后两位为248、249

修改后scan-ip最后两位为225、220

--查看修改前的/etc/hosts

[root@d2-dbrac21 ~]# cat /etc/hosts | grep 'vip\|scan'

192.168.10.23 d2-dbrac21-vip

192.168.10.24 d2-dbrac22-vip

192.168.10.25 dbrac-scan

192.168.10.20 dbrac-scan

--查看ip

[root@d2-dbrac21 ~]# ip addr | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.21/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.23/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.25/24 brd 192.168.10.255 scope global secondary ens192:2

--查看集群设置

[root@d2-dbrac21 ~]# srvctl config nodeapps

Network 1 exists

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

Ping Targets:

Network is enabled

Network is individually enabled on nodes:

Network is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac21

VIP Name: d2-dbrac21-vip

VIP IPv4 Address: 192.168.10.23

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac22

VIP Name: d2-dbrac22-vip

VIP IPv4 Address: 192.168.10.24

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false

ONS is enabled

ONS is individually enabled on nodes:

ONS is individually disabled on nodes:

只更改 VIP & SCAN IP 后的/etc/hosts,两个节点都要改

[root@d2-dbrac21 ~]# cat /etc/hosts | grep 'vip\|scan'

192.168.10.248 d2-dbrac21-vip

192.168.10.249 d2-dbrac22-vip

192.168.10.225 dbrac-scan

192.168.10.220 dbrac-scan

--重启集群节点,两个节点,可以轮流重启

crsctl stop crs

crsctl start crs

--查看重启后的节点信息,vip 自动更改了

[root@d2-dbrac21 ~]# ip addr | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.21/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.248/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.20/24 brd 192.168.10.255 scope global secondary ens192:2

[root@d2-dbrac22 ~]# ip ad | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.22/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.249/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.20/24 brd 192.168.10.255 scope global secondary ens192:2

--查看集群中节点信息

[root@d2-dbrac21 ~]# srvctl config nodeapps

Network 1 exists

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

Ping Targets:

Network is enabled

Network is individually enabled on nodes:

Network is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac21

VIP Name: d2-dbrac21-vip

VIP IPv4 Address: 192.168.10.248

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac22

VIP Name: d2-dbrac22-vip

VIP IPv4 Address: 192.168.10.249

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false

ONS is enabled

ONS is individually enabled on nodes:

ONS is individually disabled on nodes:

修改scan-ip

--停止监听

srvctl stop scan_listener

srvctl stop scan

--查看更改前的scan

srvctl config scan

[root@d2-dbrac21 ~]# srvctl config scan

SCAN name: dbrac-scan, Network: 1

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

SCAN 1 IPv4 VIP: 192.168.10.20

SCAN VIP is enabled.

SCAN 2 IPv4 VIP: 192.168.10.25

SCAN VIP is enabled.

--修改在CRS中SCAN的配置

srvctl modify scan -n dbrac-scan

--验证修改结果

srvctl config scan

[root@d2-dbrac21 ~]# srvctl config scan

SCAN name: dbrac-scan, Network: 1

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

SCAN 1 IPv4 VIP: 192.168.10.225

SCAN VIP is enabled.

SCAN 2 IPv4 VIP: 192.168.10.220

SCAN VIP is enabled.

--启动监听,启动scan listener时候,自动把scan也给启动了

srvctl start scan_listener

--查看启动后状态

srvctl status scan_listener

srvctl status scan

[root@d2-dbrac21 ~]# srvctl status scan_listener

SCAN Listener LISTENER_SCAN1 is enabled

SCAN listener LISTENER_SCAN1 is running on node d2-dbrac22

SCAN Listener LISTENER_SCAN2 is enabled

SCAN listener LISTENER_SCAN2 is running on node d2-dbrac21

[root@d2-dbrac21 ~]# srvctl status scan

SCAN VIP scan1 is enabled

SCAN VIP scan1 is running on node d2-dbrac22

SCAN VIP scan2 is enabled

SCAN VIP scan2 is running on node d2-dbrac21

--查看ip

ip addr | grep ens192

[root@d2-dbrac21 ~]# ip addr | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.21/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.248/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.220/24 brd 192.168.10.255 scope global secondary ens192:2

--查看集群中scan信息

[root@d2-dbrac21 ~]# srvctl config scan

SCAN name: dbrac-scan, Network: 1

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

SCAN 1 IPv4 VIP: 192.168.10.225

SCAN VIP is enabled.

SCAN 2 IPv4 VIP: 192.168.10.220

SCAN VIP is enabled.

相关推荐
百度智能云技术站22 分钟前
广告投放系统成本降低 70%+,基于 Redis 容量型数据库 PegaDB 的方案设计和业务实践
数据库·redis·oracle
梦想平凡2 小时前
PHP 微信棋牌开发全解析:高级教程
android·数据库·oracle
夏木~4 小时前
Oracle 中什么情况下 可以使用 EXISTS 替代 IN 提高查询效率
数据库·oracle
吴冰_hogan5 小时前
MySQL InnoDB 存储引擎 Redo Log(重做日志)详解
数据库·oracle
CodeCraft Studio5 小时前
【实用技能】如何在 SQL Server 中处理 Null 或空值?
数据库·oracle·sqlserver
武汉联从信息6 小时前
浅谈ORACLE中间件SOA BPM,IDM,OID,UCM,WebcenterPortal服务器如何做迁移切换
oracle
Elastic 中国社区官方博客7 小时前
Elasticsearch:什么是查询语言?
大数据·数据库·elasticsearch·搜索引擎·oracle
夜光小兔纸7 小时前
oracle dblink 的创建及使用
数据库·oracle
Smile丶凉轩8 小时前
MySQL库的操作
数据库·mysql·oracle
p@nd@10 小时前
Oracle筑基篇-调度算法-LRU的引入
数据库·oracle·操作系统·lru