绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
Oracle RAC 如何增加私网,删除私网以及修改私网相关属性
2021-12-07 22:05:49

RAC的私网及其重要,一旦系统配置与gpnp记录不匹配,集群就无法启动,我们往往有这样的需求,增加私网,删除故障私网,或者修改私网属性,这里是完整的测试。也是我们后续一个实施方案的测试过程。这里提示,这个操作需要先备份profile.xml然后必须重启集群,新的配置才能生效。


实施操作前

用户Grid用户备份 每个节点的profile.xml

$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/

$ cp -p profile.xml profile.xml.bk

 查询配置

root@test1 ~]# oifcfg getif

eth0  192.168.56.0  global  public

eth1  192.168.57.0  global  cluster_interconnect,asm

下面增加两个私网,这是修改OCR,不会改变当前私网运行,新加私网也不会生效

[root@test1 ~]# oifcfg setif -global eth2/192.168.58.0:cluster_interconnect

[root@test1 ~]# oifcfg setif -global eth3/192.168.59.0:cluster_interconnect

[root@test1 ~]# oifcfg getif

eth0  192.168.56.0  global  public

eth1  192.168.57.0  global  cluster_interconnect,asm

eth2  192.168.58.0  global  cluster_interconnect

eth3  192.168.59.0  global  cluster_interconnect


观察网卡状态,此时eth2 eth3没有HAIP地址出现,说明没有生效

eth1      Link encap:Ethernet  HWaddr 08:00:27:97:01:95  

          inet addr:192.168.57.101  Bcast:192.168.57.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe97:195/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:100099 errors:0 dropped:0 overruns:0 frame:0

          TX packets:76110 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:77255048 (73.6 MiB)  TX bytes:42388024 (40.4 MiB)


eth1:1    Link encap:Ethernet  HWaddr 08:00:27:97:01:95  

          inet addr:169.254.79.128  Bcast:169.254.255.255  Mask:255.255.0.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth2      Link encap:Ethernet  HWaddr 08:00:27:74:A7:E9  

          inet addr:192.168.58.102  Bcast:192.168.58.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe74:a7e9/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:160 errors:0 dropped:0 overruns:0 frame:0

          TX packets:175 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:88116 (86.0 KiB)  TX bytes:77953 (76.1 KiB)


eth3      Link encap:Ethernet  HWaddr 08:00:27:4B:50:17  

          inet addr:192.168.59.102  Bcast:192.168.59.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe4b:5017/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:143 errors:0 dropped:0 overruns:0 frame:0

          TX packets:139 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:62039 (60.5 KiB)  TX bytes:30466 (29.7 KiB)


两个节点都关闭集群,并重启集群


crctl stop crs 

crsctl start crs


继续观察私网信息

eth1      Link encap:Ethernet  HWaddr 08:00:27:97:01:95  

          inet addr:192.168.57.101  Bcast:192.168.57.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe97:195/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:152294 errors:0 dropped:0 overruns:0 frame:0

          TX packets:119297 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:116130563 (110.7 MiB)  TX bytes:69080804 (65.8 MiB)


eth1:1    Link encap:Ethernet  HWaddr 08:00:27:97:01:95  

          inet addr:169.254.230.134  Bcast:169.254.255.255  Mask:255.255.192.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth1:2    Link encap:Ethernet  HWaddr 08:00:27:97:01:95  

          inet addr:169.254.42.255  Bcast:169.254.63.255  Mask:255.255.192.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth2      Link encap:Ethernet  HWaddr 08:00:27:74:A7:E9  

          inet addr:192.168.58.102  Bcast:192.168.58.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe74:a7e9/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:26660 errors:0 dropped:0 overruns:0 frame:0

          TX packets:19874 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:19709099 (18.7 MiB)  TX bytes:9613082 (9.1 MiB)


eth2:1    Link encap:Ethernet  HWaddr 08:00:27:74:A7:E9  

          inet addr:169.254.122.101  Bcast:169.254.127.255  Mask:255.255.192.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth3      Link encap:Ethernet  HWaddr 08:00:27:4B:50:17  

          inet addr:192.168.59.102  Bcast:192.168.59.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe4b:5017/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:27191 errors:0 dropped:0 overruns:0 frame:0

          TX packets:19544 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:20278283 (19.3 MiB)  TX bytes:8949351 (8.5 MiB)


eth3:1    Link encap:Ethernet  HWaddr 08:00:27:4B:50:17  

          inet addr:169.254.129.182  Bcast:169.254.191.255  Mask:255.255.192.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


此时eth1eth2eth3都有了haip地址。此时集群的私网配置如下

[root@test1 ~]# oifcfg getif

eth0  192.168.56.0  global  public

eth1  192.168.57.0  global  cluster_interconnect,asm

eth2  192.168.58.0  global  cluster_interconnect

eth3  192.168.59.0  global  cluster_interconnect


下面测试修改私网属性并删除一个私网。

1 当前配置

[root@test1 ~]# oifcfg getif

eth0  192.168.56.0  global  public

eth1  192.168.57.0  global  cluster_interconnect,asm

eth2  192.168.58.0  global  cluster_interconnect

eth3  192.168.59.0  global  cluster_interconnect


2 修改eth2eth3的属性,用于asm,此时的setif操作写入OCR


[root@test1 ~]# oifcfg setif -global eth2/192.168.58.0:cluster_interconnect,asm

[root@test1 ~]# oifcfg setif -global eth3/192.168.59.0:cluster_interconnect,asm


[root@test1 ~]# oifcfg getif   

eth0  192.168.56.0  global  public

eth1  192.168.57.0  global  cluster_interconnect,asm

eth2  192.168.58.0  global  cluster_interconnect,asm

eth3  192.168.59.0  global  cluster_interconnect,asm


删除私网eth1

[root@test1 ~]# oifcfg delif -global eth1/192.168.57.0

[root@test1 ~]# oifcfg getif

eth0  192.168.56.0  global  public

eth2  192.168.58.0  global  cluster_interconnect,asm

eth3  192.168.59.0  global  cluster_interconnect,asm


关闭并重启集群

crsctl stop crs

crsctl start crs


检查私网信息,此时eth1 没有了HAIP,说明删除成功

eth1      Link encap:Ethernet  HWaddr 08:00:27:97:01:95  

          inet addr:192.168.57.101  Bcast:192.168.57.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe97:195/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:155642 errors:0 dropped:0 overruns:0 frame:0

          TX packets:123978 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:118171575 (112.6 MiB)  TX bytes:73246800 (69.8 MiB)


eth2      Link encap:Ethernet  HWaddr 08:00:27:74:A7:E9  

          inet addr:192.168.58.102  Bcast:192.168.58.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe74:a7e9/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:62587 errors:0 dropped:0 overruns:0 frame:0

          TX packets:52547 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:46421432 (44.2 MiB)  TX bytes:32109572 (30.6 MiB)


eth2:1    Link encap:Ethernet  HWaddr 08:00:27:74:A7:E9  

          inet addr:169.254.2.93  Bcast:169.254.127.255  Mask:255.255.128.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth3      Link encap:Ethernet  HWaddr 08:00:27:4B:50:17  

          inet addr:192.168.59.102  Bcast:192.168.59.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe4b:5017/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:61986 errors:0 dropped:0 overruns:0 frame:0

          TX packets:47921 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:46222012 (44.0 MiB)  TX bytes:25582386 (24.3 MiB)


eth3:1    Link encap:Ethernet  HWaddr 08:00:27:4B:50:17  

          inet addr:169.254.192.83  Bcast:169.254.255.255  Mask:255.255.128.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


下面是集群状态

[root@test1 ~]# srvctl config asm 

ASM home: <CRS home>

Password file: +ASMCRS/orapwASM

ASM listener: LISTENER

[root@test1 ~]# oifcfg getif

eth0  192.168.56.0  global  public

eth2  192.168.58.0  global  cluster_interconnect,asm

eth3  192.168.59.0  global  cluster_interconnect,asm


[root@test1 ~]# crsctl stat res -t -init

--------------------------------------------------------------------------------

Name           Target  State        Server                   State details       

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.asm

      1        ONLINE  ONLINE       test1                    Started,STABLE

ora.cluster_interconnect.haip

      1        ONLINE  ONLINE       test1                    STABLE

ora.crf

      1        ONLINE  ONLINE       test1                    STABLE

ora.crsd

      1        ONLINE  ONLINE       test1                    STABLE

ora.cssd

      1        ONLINE  ONLINE       test1                    STABLE

ora.cssdmonitor

      1        ONLINE  ONLINE       test1                    STABLE

ora.ctssd

      1        ONLINE  ONLINE       test1                    ACTIVE:0,STABLE

ora.diskmon

      1        OFFLINE OFFLINE                               STABLE

ora.drivers.acfs

      1        ONLINE  ONLINE       test1                    STABLE

ora.evmd

      1        ONLINE  ONLINE       test1                    STABLE

ora.gipcd

      1        ONLINE  ONLINE       test1                    STABLE

ora.gpnpd

      1        ONLINE  ONLINE       test1                    STABLE

ora.mdnsd

      1        ONLINE  ONLINE       test1                    STABLE

ora.storage

      1        ONLINE  ONLINE       test1                    STABLE

--------------------------------------------------------------------------------

分享好友

分享这个小栈给你的朋友们,一起进步吧。

Oracle运维新鲜事-技术与管理各占半边天
创建时间:2020-08-04 11:34:57
本技术栈旨在分享技术心得,运维趣事,故障处理经验,调优案例,故障处理涉及集群,DG,OGG,大家生产中遇到的问题基本都会囊括了,我会发布生产库遇到的故障,希望在交流中互助互益,共同提高,也希望大家讨论,如果您有生产中遇到的集群问题,也可以在这里提出来,一起讨论,现实中也帮助不少同学解决了生产库的故障。
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

栈主、嘉宾

查看更多
  • Abraham林老师
    栈主
  • 小雨滴
    嘉宾
  • hawkliu
    嘉宾
  • u_97a59a25246404
    嘉宾

小栈成员

查看更多
  • 栈栈
  • dapan
  • 小菜鸟___
  • hwayw
戳我,来吐槽~