IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    11gr2 rac改IP系列之四:修改私网IP为其它IP

    Guang Cai Li发表于 2023-09-17 06:59:48
    love 0

    ————————–
    修改私有ip为其它网段IP。
    —————–修改前:
    192.168.58.1 bys1-priv.bys.com bys1-priv
    192.168.58.2 bys2-priv.bys.com bys2-priv
    —————–修改后:
    192.168.59.1 bys1-priv.bys.com bys1-priv
    192.168.59.2 bys2-priv.bys.com bys2-priv
    参考MOS文档:How to Modify Private Network Information in Oracle Clusterware (文档 ID 283684.1)
    从11.2 Grid Infrastructure开始,私有网络配置存储在OCR和gpnp配置文件中。 如果专用网络不可用或其定义不正确,CRSD进程将不会启动,并且后续不能对OCR进行更改。 注意,不支持手动修改gpnp配置文件。
    ——–目录
    1.备份gpnp配置文件
    2.查看当前集群是运行状态及OS层面网卡信息
    3.查看并修改私网配置信息–单个节点进行
    4.关闭CRS–两个节点均进行
    5.OS层面修改IP并修改/etc/hosts中记录(两个节点均修改)并测通
    6.重新启动集群
    7.删除原有私网信息并验证
    8.检查集群状态
    —————————
    ###########################
    —————————
    具体步骤:–仅显示节点1,节点2同样步骤。

    1.备份gpnp配置文件
    $ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
    —
    [grid@bys1 ~]$ cd /u01/11.2.0/grid/gpnp/bys1/profiles/peer/
    [grid@bys1 peer]$ ls
    pending.xml profile.old profile_orig.xml profile.xml
    [grid@bys1 peer]$ cp profile.xml profile.xmlbak

    [grid@bys2 ~]$ cd /u01/11.2.0/grid/gpnp/bys2/profiles/peer/
    [grid@bys2 peer]$ cp profile.xml profile.xmlbak

    2.查看当前集群是运行状态及OS层面网卡信息
    [grid@bys2 peer]$ crsctl stat res -t
    ——————————————————————————–
    NAME TARGET STATE SERVER STATE_DETAILS
    ——————————————————————————–
    Local Resources
    ——————————————————————————–
    ora.DATA.dg
    ONLINE ONLINE bys1
    ONLINE ONLINE bys2
    ora.LISTENER.lsnr
    ONLINE ONLINE bys1
    ONLINE ONLINE bys2
    ora.asm
    ONLINE ONLINE bys1 Started
    ONLINE ONLINE bys2 Started
    ora.gsd
    OFFLINE OFFLINE bys1
    OFFLINE OFFLINE bys2
    ora.net1.network
    ONLINE ONLINE bys1
    ONLINE ONLINE bys2
    ora.ons
    ONLINE ONLINE bys1
    ONLINE ONLINE bys2
    ——————————————————————————–
    Cluster Resources
    ——————————————————————————–
    ora.LISTENER_SCAN1.lsnr
    1 ONLINE ONLINE bys1
    ora.bys1.vip
    1 ONLINE ONLINE bys1
    ora.bys2.vip
    1 ONLINE ONLINE bys2
    ora.bysrac.db
    1 ONLINE ONLINE bys1 Open
    2 OFFLINE OFFLINE Instance Shutdown
    ora.cvu
    1 ONLINE ONLINE bys2
    ora.oc4j
    1 ONLINE ONLINE bys2
    ora.scan1.vip
    1 ONLINE ONLINE bys1

    ###############
    3.查看并修改私网配置信息–单个节点进行
    —
    [grid@bys1 peer]$ oifcfg getif
    eth0 192.168.57.0 global public
    eth1 192.168.58.0 global cluster_interconnect
    [grid@bys1 peer]$ oifcfg iflist
    eth0 192.168.57.0
    eth1 192.168.58.0
    eth1 169.254.0.0

    [grid@bys1 peer]$ oifcfg setif -global eth1/192.168.59.0:cluster_interconnect
    [grid@bys1 peer]$ oifcfg getif
    eth0 192.168.57.0 global public
    eth1 192.168.58.0 global cluster_interconnect
    eth1 192.168.59.0 global cluster_interconnect

    ##############
    4.关闭CRS–两个节点均进行
    [root@bys1 ~]# crsctl stop crs
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘bys1’
    ………………
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘bys1’ has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    [root@bys1 ~]# crsctl disable crs
    CRS-4621: Oracle High Availability Services autostart is disabled.

    ###############
    5.OS层面修改IP并修改/etc/hosts中记录(两个节点均修改)并测通

    —————–修改前:
    192.168.58.1 bys1-priv.bys.com bys1-priv
    192.168.58.2 bys2-priv.bys.com bys2-priv
    —————–修改后:
    192.168.59.1 bys1-priv.bys.com bys1-priv
    192.168.59.2 bys2-priv.bys.com bys2-priv

    [root@bys2 network-scripts]# ifconfig

    eth1 Link encap:Ethernet HWaddr 08:00:27:4B:EE:4E
    inet addr:192.168.59.2 Bcast:192.168.59.255 Mask:255.255.255.0
    inet6 addr: fe80::a00:27ff:fe4b:ee4e/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:13462 errors:0 dropped:0 overruns:0 frame:0
    TX packets:15323 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:6890589 (6.5 MiB) TX bytes:11488864 (10.9 MiB)
    [root@bys2 network-scripts]# ping bys1-priv
    PING bys1-priv.bys.com (192.168.59.1) 56(84) bytes of data.
    64 bytes from bys1-priv.bys.com (192.168.59.1): icmp_seq=1 ttl=64 time=2.85 ms
    ###############
    6.重新启动集群

    [root@bys2 ~]# crsctl enable crs
    CRS-4622: Oracle High Availability Services autostart is enabled.
    [root@bys2 ~]# crsctl start crs
    CRS-4123: Oracle High Availability Services has been started.

    ###############
    7.删除原有私网信息并验证
    [grid@bys1 ~]$ oifcfg getif
    eth0 192.168.57.0 global public
    eth1 192.168.58.0 global cluster_interconnect
    eth1 192.168.59.0 global cluster_interconnect
    [grid@bys1 ~]$ oifcfg delif -global eth1/192.168.58.0:cluster_interconnect
    [grid@bys1 ~]$ oifcfg getif
    eth0 192.168.57.0 global public
    eth1 192.168.59.0 global cluster_interconnect

    ###############
    8.检查集群状态
    [grid@bys1 ~]$ gpnptool get
    Warning: some command line parameters were defaulted. Resulting command line:
    /u01/11.2.0/grid/bin/gpnptool.bin get -o-

    <?xml version=”1.0″ encoding=”UTF-8″?><gpnp:GPnP-Profile Version=”1.0″ xmlns=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:gpnp=”http://www.grid-pnp.org/2005/11/gpnp-profile” xmlns:orcl=”http://www.oracle.com/gpnp/2005/11/gpnp-profile” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd” ProfileSequence=”8″ ClusterUId=”405460e2b8c24fd8bf9acebf33654b8b” ClusterName=”bysrac” PALocation=””><gpnp:Network-Profile><gpnp:HostNetwork id=”gen” HostName=”*”><gpnp:Network id=”net1″ IP=”192.168.57.0″ Adapter=”eth0″ Use=”public”/><gpnp:Network id=”net4″ Adapter=”eth1″ IP=”192.168.59.0″ Use=”cluster_interconnect”/></gpnp:HostNetwork></gpnp:Network-Profile><orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/><orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/asm*” SPFile=”+DATA/bysrac/asmparameterfile/registry.253.927488691″/><ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”/><ds:SignatureMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#rsa-sha1″/><ds:Reference URI=””><ds:Transforms><ds:Transform Algorithm=”http://www.w3.org/2000/09/xmldsig#enveloped-signature”/><ds:Transform Algorithm=”http://www.w3.org/2001/10/xml-exc-c14n#”> <InclusiveNamespaces xmlns=”http://www.w3.org/2001/10/xml-exc-c14n#” PrefixList=”gpnp orcl xsi”/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=”http://www.w3.org/2000/09/xmldsig#sha1″/><ds:DigestValue>TQTgFHyy0z8ROUI6tfleTxsQwdY=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>F3N8CS7gBNJXMfMHZuP/FckLtynkybtNFq3TbHuU9yrZEuDuzMA1EtMmId7W7YPDS1wBZ6Qrh4hKMDuXfWTSR6xHZQ9iFM6mC6vHTa13+7AGYopoat5iXnGd050jj/w/VMhiYUQuP5g5O28SUu6lHRlhzpnPZLUkyhKvmhRdpIM=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>
    Success.

    [grid@bys1 ~]$ ifconfig
    eth1 Link encap:Ethernet HWaddr 08:00:27:64:B0:1C
    inet addr:192.168.59.1 Bcast:192.168.59.255 Mask:255.255.255.0
    inet6 addr: fe80::a00:27ff:fe64:b01c/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:21137 errors:0 dropped:0 overruns:0 frame:0
    TX packets:18486 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:14069238 (13.4 MiB) TX bytes:11326935 (10.8 MiB)

    eth1:1 Link encap:Ethernet HWaddr 08:00:27:64:B0:1C
    inet addr:169.254.167.252 Bcast:169.254.255.255 Mask:255.255.0.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

     



沪ICP备19023445号-2号
友情链接