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.