最近新装一套19c两节点rac,客户要求改一下私网ip,修改过程相比11g还是有很大的不一样,记录一下。
背景:
(1)私网ip由192.168.1.71/72改为192.168.1.2/3
(2)涉及subnet变化
192.168.1.71/72的subnet是192.168.1.64
192.168.1.2/3的subnet是192.168.1.0
(3)网卡名无需修改
参考文档:how to modify private network information in oracle clusterware (doc id 283684.1)
1. 备份gpnp profile
[grid@xyjzxdb01 ~]$ cd $oracle_home/gpnp/profiles/peer
[grid@xyjzxdb01 peer]$ cp profile.xml profile.xml.bak
2. 确保所有节点crs为启动状态
[grid@xyjzxdb01 ~]$ 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
3. 获取当前网络接口信息
[grid@xyjzxdb01 ~]$ oifcfg getif
team0 172.19.245.64 global public
team1 192.168.1.64 global cluster_interconnect,asm
4. 修改网络接口信息,在一个节点执行
[grid@xyjzxdb01 ~]$ oifcfg setif -global team1/192.168.1.0:cluster_interconnect,asm
[grid@xyjzxdb01 ~]$ oifcfg getif
team0 172.19.245.64 global public
team1 192.168.1.64 global cluster_interconnect,asm
team1 192.168.1.0 global cluster_interconnect,asm
note:
- 即使接口不可用,也可以使用-global选项,但是如果接口不可用,则不能使用-node选项,否则会导致节点退出。
- oifcfg iflist --列出网络接口和子网地址,即使oracle clusterware没有运行,也可以运行该命令
5. 停所有节点crs
[root@xyjzxdb01 ~]# crsctl stop crs
6. 修改os网络配置,确保修改后的接口在所有节点上都可用
[root@xyjzxdb01 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.19.245.71 xyjzxdb01
172.19.245.72 xyjzxdb02
172.19.245.73 xyjzxdb01-vip
172.19.245.74 xyjzxdb02-vip
172.19.245.75 xyjzxdb-scan
192.168.1.2 xyjzxdb01-priv
192.168.1.3 xyjzxdb02-priv
[root@xyjzxdb01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team1
team_config='{"runner":{"name":"activebackup"},"link_watch":{"name":"ethtool"}}'
name=team1
device=team1
onboot=yes
devicetype=team
ipaddr=192.168.1.2
prefix=26
mtu=1500
[root@xyjzxdb02 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team1
team_config='{"runner":{"name":"activebackup"},"link_watch":{"name":"ethtool"}}'
name=team1
device=team1
onboot=yes
devicetype=team
ipaddr=192.168.1.3
prefix=26
mtu=1500
重启网卡
[root@xyjzxdb01 ~]# systemctl restart network
确认所有节点修改成功
[root@xyjzxdb01 ~]# ifconfig -a
......
team1: flags=4163 mtu 1500
inet 192.168.1.2 netmask 255.255.255.192 broadcast 192.168.1.63
inet6 fe80::250:56ff:fe9a:a3a0 prefixlen 64 scopeid 0x20
ether 00:50:56:9a:a3:a0 txqueuelen 1000 (ethernet)
rx packets 7 bytes 374 (374.0 b)
rx errors 0 dropped 0 overruns 0 frame 0
tx packets 11 bytes 782 (782.0 b)
tx errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@xyjzxdb02 ~]# ifconfig -a
......
team1: flags=4163 mtu 1500
inet 192.168.1.3 netmask 255.255.255.192 broadcast 192.168.1.63
inet6 fe80::250:56ff:fe9a:f1d8 prefixlen 64 scopeid 0x20
ether 00:50:56:9a:f1:d8 txqueuelen 1000 (ethernet)
rx packets 2 bytes 122 (122.0 b)
rx errors 0 dropped 0 overruns 0 frame 0
tx packets 11 bytes 830 (830.0 b)
tx errors 0 dropped 0 overruns 0 carrier 0 collisions 0
确认相互能ping通
[root@xyjzxdb01 ~]# ping 192.168.1.3
ping 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=0.334 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=0.307 ms
64 bytes from 192.168.1.3: icmp_seq=3 ttl=64 time=0.557 ms
[root@xyjzxdb02 ~]# ping 192.168.1.2
ping 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.293 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.427 ms
64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.420 ms
查看修改后的网络接口和子网地址
[root@xyjzxdb01 ~]# oifcfg iflist
team1 192.168.1.0
team0 172.19.245.64
[root@xyjzxdb02 ~]# oifcfg iflist
team1 192.168.1.0
team0 172.19.245.64
7. 启动所有节点crs
[root@xyjzxdb02 ~]# crsctl stat res -t -init
--------------------------------------------------------------------------------
name target state server state details
--------------------------------------------------------------------------------
cluster resources
--------------------------------------------------------------------------------
ora.asm
1 online online xyjzxdb02 stable
ora.cluster_interconnect.haip
1 online online xyjzxdb02 stable
ora.crf
1 online online xyjzxdb02 stable
ora.crsd
1 online offline xyjzxdb02 stable
ora.cssd
1 online online xyjzxdb02 stable
ora.cssdmonitor
1 online online xyjzxdb02 stable
ora.ctssd
1 online online xyjzxdb02 active:0,stable
ora.diskmon
1 offline offline stable
ora.drivers.acfs
1 online online xyjzxdb02 stable
ora.evmd
1 online online xyjzxdb02 stable
ora.gipcd
1 online online xyjzxdb02 stable
ora.gpnpd
1 online online xyjzxdb02 stable
ora.mdnsd
1 online online xyjzxdb02 stable
ora.storage
1 online online xyjzxdb02 starting ---一直starting,无法online
--------------------------------------------------------------------------------
--只能第一个节点启动,第二个节点始终起不来,ora.storage一直是starting状态,asm实例也没有启动
8. 删除原来的网络接口后再尝试启动第二个节点
[root@xyjzxdb01 ~]# oifcfg delif -global team1/192.168.1.64
[root@xyjzxdb01 ~]# oifcfg getif
team0 172.19.245.64 global public
team1 192.168.1.0 global cluster_interconnect,asm
第二个节点仍然无法启动
9. 发现正常的1节点,ora.asmnet1lsnr_asm.lsnr和ora.asmnet1.asmnetwork状态都不正常,怀疑跟它有关
[root@xyjzxdb01 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
name target state server state details
--------------------------------------------------------------------------------
local resources
--------------------------------------------------------------------------------
ora.listener.lsnr
online online xyjzxdb01 stable
ora.chad
online online xyjzxdb01 stable
ora.net1.network
online online xyjzxdb01 stable
ora.ons
online online xyjzxdb01 stable
ora.proxy_advm
offline offline xyjzxdb01 stable
--------------------------------------------------------------------------------
cluster resources
--------------------------------------------------------------------------------
ora.asmnet1lsnr_asm.lsnr(ora.asmgroup)
1 online offline stable ----正常的1节点也是offline状态
2 online offline stable
ora.data.dg(ora.asmgroup)
1 online online xyjzxdb01 stable
2 offline offline stable
ora.fra.dg(ora.asmgroup)
1 online online xyjzxdb01 stable
2 offline offline stable
ora.listener_scan1.lsnr
1 online online xyjzxdb01 stable
ora.ocrdg.dg(ora.asmgroup)
1 online online xyjzxdb01 stable
2 offline offline stable
ora.asm(ora.asmgroup)
1 online online xyjzxdb01 started,stable
2 online offline stable
ora.asmnet1.asmnetwork(ora.asmgroup)
1 online offline stable ----正常的1节点也是offline状态
2 online offline stable
ora.cvu
1 online online xyjzxdb01 stable
ora.qosmserver
1 online online xyjzxdb01 stable
ora.scan1.vip
1 online online xyjzxdb01 stable
ora.xyjzxdb.db
1 online online xyjzxdb01 open,home=/oracle/ap
p/oracle/product/19c
/dbhome_1,stable
2 online offline stable
ora.xyjzxdb01.vip
1 online online xyjzxdb01 stable
ora.xyjzxdb02.vip
1 online intermediate xyjzxdb01 failed over,stable
--------------------------------------------------------------------------------
10. 检查各种配置
[root@xyjzxdb01 ~]# srvctl config asmnetwork
asm network 1 exists
**subnet ipv4: 192.168.1.64//**
subnet ipv6:
network is enabled
network is individually enabled on nodes:
network is individually disabled on nodes:
[root@xyjzxdb01 ~]# srvctl config listener -asmlistener
name: asmnet1lsnr_asm
type: asm listener
owner: grid
**subnet: 192.168.1.64**
home:
end points: tcp:1525
listener is enabled.
listener is individually enabled on nodes:
listener is individually disabled on nodes:
asm listener里的subnet配置仍然显示为192.168.1.64,确认是它的问题
11. 添加新的asmlistener,并删除原来的
[grid@xyjzxdb01 ~]$ srvctl add listener -asmlistener -l asmnewlsnr_asm -subnet 192.168.1.0
[grid@xyjzxdb01 ~]$ srvctl update listener -listener asmnet1lsnr_asm -asm -remove -force
[grid@xyjzxdb01 ~]$ srvctl config listener -asmlistener
name: asmnewlsnr_asm
type: asm listener
owner: grid
subnet: 192.168.1.0 --已修改成功,原来为192.168.1.64
home:
end points: tcp:1526
listener is enabled.
listener is individually enabled on nodes:
listener is individually disabled on nodes:
[grid@xyjzxdb01 ~]$ srvctl config asm
asm home:
password file: ocrdg/orapwasm
backup of password file: ocrdg/orapwasm_backup
asm listener: listener
asm instance count: 2
cluster asm listener: asmnewlsnr_asm --已修改成功,原来为asmnet1lsnr_asm
确认已经修改成功
12. 在19c中,有一个名为ora.asmnet1的新资源,也需要更新
[root@xyjzxdb01 ~]# srvctl remove asmnetwork -netnum 1
[root@xyjzxdb01 ~]# srvctl add asmnetwork -netnum 1 -subnet 192.168.1.0
13. 完成后,启动正常
[root@xyjzxdb01 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
name target state server state details
--------------------------------------------------------------------------------
local resources
--------------------------------------------------------------------------------
ora.listener.lsnr
online online xyjzxdb01 stable
online online xyjzxdb02 stable
ora.chad
online online xyjzxdb01 stable
online online xyjzxdb02 stable
ora.net1.network
online online xyjzxdb01 stable
online online xyjzxdb02 stable
ora.ons
online online xyjzxdb01 stable
online online xyjzxdb02 stable
ora.proxy_advm
offline offline xyjzxdb01 stable
offline offline xyjzxdb02 stable
--------------------------------------------------------------------------------
cluster resources
--------------------------------------------------------------------------------
ora.asmnewlsnr_asm.lsnr(ora.asmgroup)
1 online online xyjzxdb01 stable
2 online online xyjzxdb02 stable
ora.data.dg(ora.asmgroup)
1 online online xyjzxdb01 stable
2 online online xyjzxdb02 stable
ora.fra.dg(ora.asmgroup)
1 online online xyjzxdb01 stable
2 online online xyjzxdb02 stable
ora.listener_scan1.lsnr
1 online online xyjzxdb01 stable
ora.ocrdg.dg(ora.asmgroup)
1 online online xyjzxdb01 stable
2 online online xyjzxdb02 stable
ora.asm(ora.asmgroup)
1 online online xyjzxdb01 started,stable
2 online online xyjzxdb02 started,stable
ora.asmnet1.asmnetwork(ora.asmgroup)
1 offline offline stable --两个节点都变成了offline,但是对数据库没有影响
2 offline offline stable
ora.cvu
1 online online xyjzxdb01 stable
ora.qosmserver
1 online online xyjzxdb01 stable
ora.scan1.vip
1 online online xyjzxdb01 stable
ora.xyjzxdb.db
1 online online xyjzxdb01 open,home=/oracle/ap --2个节点db都online
p/oracle/product/19c
/dbhome_1,stable
2 online online xyjzxdb02 open,home=/oracle/ap
p/oracle/product/19c
/dbhome_1,stable
ora.xyjzxdb01.vip
1 online online xyjzxdb01 stable
ora.xyjzxdb02.vip
1 online online xyjzxdb02 stable
--------------------------------------------------------------------------------
- 两个节点的ora.asmnet1.asmnetwork都变成了offline,但是db都已经online,对数据库应该没有影响
- 本来打算查下启动的命令,但既然没有用到,索性不启动了(启动命令:srvctl start asmnetwork -netnum 1)
最后修改时间:2023-11-29 20:36:57
【米乐app官网下载的版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。