yinl_li 发表于 2018-9-12 11:55:06

Oracle 11g RAC 修改IP

  Oracle 11g RAC 修改IP
  
  在RAC环境下修改ip地址,会造成数据库停机,所以在搭建、配置RAC前,必须做好ip规划,而主机名是不允许修改的,如果修改必须重新安装CRS.
  系统环境:
  操作系统:RedHat EL5.5
  集群软件: GI 11G
  数据库软件:Oracle 11.2.0.1
  
  
  修改ip 方法:
  一、禁用和停止相关的resource
  
  1)禁用和停止 vip service
  # srvctl disable vip -h
  Disable the VIPs from Oracle Clusterware management.
  Usage: srvctl disable vip -i[-v]
  -i             VIP name
  -h                     Print usage
  -v                     Verbose output
  # srvctl disable vip -i "node1-vip"
  # srvctl disable vip -i "node2-vip"
  
  # srvctl stop vip -h
  Stop the specified VIP or VIPs on a node.
  Usage: srvctl stop vip { -n   | -i} [-f] [-r] [-v]
  -n            Node name
  -i             VIP name

  -r                      >  -f                     Force stop
  -h                     Print usage
  -v                     Verbose output
  # srvctl stop vip -n node1
  # srvctl stop vip -n node2
  2)禁用和停止listener
  # srvctl disable listener
  # srvctl stop listener
  3)禁用和停止scan及scan_listener
  # srvctl disable scan_listener
  # srvctl stop scan_listener
  # srvctl disable scan
  # srvctl stop scan
  #
  4)在所有节点停止CRS 服务
  # crsctl stop crs
  CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'node1'
  CRS-2673: Attempting to stop 'ora.crsd' on 'node1'
  CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'node1'
  CRS-2673: Attempting to stop 'ora.DG2.dg' on 'node1'
  CRS-2673: Attempting to stop 'ora.OCR_VOTE.dg' on 'node1'
  CRS-2673: Attempting to stop 'ora.registry.acfs' on 'node1'
  CRS-2673: Attempting to stop 'ora.DG1.dg' on 'node1'
  CRS-2673: Attempting to stop 'ora.RCY1.dg' on 'node1'
  CRS-2677: Stop of 'ora.registry.acfs' on 'node1' succeeded
  CRS-2677: Stop of 'ora.OCR_VOTE.dg' on 'node1' succeeded
  CRS-2677: Stop of 'ora.RCY1.dg' on 'node1' succeeded
  CRS-2677: Stop of 'ora.DG2.dg' on 'node1' succeeded
  CRS-2677: Stop of 'ora.DG1.dg' on 'node1' succeeded
  CRS-2673: Attempting to stop 'ora.asm' on 'node1'
  CRS-2677: Stop of 'ora.asm' on 'node1' succeeded
  CRS-2673: Attempting to stop 'ora.eons' on 'node1'
  CRS-2673: Attempting to stop 'ora.ons' on 'node1'
  CRS-2677: Stop of 'ora.ons' on 'node1' succeeded
  CRS-2673: Attempting to stop 'ora.net1.network' on 'node1'
  CRS-2677: Stop of 'ora.net1.network' on 'node1' succeeded
  CRS-2677: Stop of 'ora.eons' on 'node1' succeeded
  CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'node1' has completed
  CRS-2677: Stop of 'ora.crsd' on 'node1' succeeded
  CRS-2673: Attempting to stop 'ora.mdnsd' on 'node1'
  CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'node1'
  CRS-2673: Attempting to stop 'ora.ctssd' on 'node1'
  CRS-2673: Attempting to stop 'ora.evmd' on 'node1'
  CRS-2673: Attempting to stop 'ora.asm' on 'node1'
  CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'node1'
  CRS-2677: Stop of 'ora.cssdmonitor' on 'node1' succeeded
  CRS-2677: Stop of 'ora.mdnsd' on 'node1' succeeded
  CRS-2677: Stop of 'ora.ctssd' on 'node1' succeeded
  CRS-2677: Stop of 'ora.evmd' on 'node1' succeeded
  CRS-2677: Stop of 'ora.asm' on 'node1' succeeded
  CRS-2673: Attempting to stop 'ora.cssd' on 'node1'
  CRS-2677: Stop of 'ora.cssd' on 'node1' succeeded
  CRS-2673: Attempting to stop 'ora.gpnpd' on 'node1'
  CRS-2673: Attempting to stop 'ora.diskmon' on 'node1'
  CRS-2677: Stop of 'ora.drivers.acfs' on 'node1' succeeded
  CRS-2677: Stop of 'ora.gpnpd' on 'node1' succeeded
  CRS-2673: Attempting to stop 'ora.gipcd' on 'node1'
  CRS-2677: Stop of 'ora.gipcd' on 'node1' succeeded
  CRS-2677: Stop of 'ora.diskmon' on 'node1' succeeded
  CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node1' has completed
  CRS-4133: Oracle High Availability Services has been stopped.
  二、在操作系统下修改IP(所有节点)
  # cat/etc/hosts(原ip 信息)
  # Do not remove the following line, or various programs
  # that require network functionality will fail.
  127.0.0.1                localhost
  192.168.8.11node1
  192.168.8.13node1-vip
  10.10.10.11node1-priv
  192.168.8.12node2
  192.168.8.14node2-vip
  10.10.10.12   node2-priv
  192.168.8.15   rac_scan
  # vi /etc/hosts(修改后ip 信息)
  # Do not remove the following line, or various programs
  # that require network functionality will fail.
  127.0.0.1                localhost
  192.168.8.111node1
  192.168.8.113node1-vip
  10.10.10.11node1-priv
  192.168.8.112node2
  192.168.8.114node2-vip
  10.10.10.12   node2-priv
  192.168.8.115   rac_scan
  ~
  # vi /etc/sysconfig/network-scripts/ifcfg-eth0
  三、重新启动CRS 服务
  # crsctl start crs
  CRS-4123: Oracle High Availability Services has been started.
  # 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
  被禁用服务未启动
  # crs_stat -t
  Name         Type         Target    State   Host
  ------------------------------------------------------------
  ora.DG1.dg   ora....up.type OFFLINE   OFFLINE
  ora.DG2.dg   ora....up.type ONLINE    ONLINE    node2
  ora....ER.lsnr ora....er.type OFFLINE   OFFLINE
  ora....N1.lsnr ora....er.type OFFLINE   OFFLINE
  ora....VOTE.dg ora....up.type ONLINE    ONLINE    node1
  ora.RCY1.dg    ora....up.type ONLINE    ONLINE    node2
  ora.asm      ora.asm.type   ONLINE    ONLINE    node1
  ora.eons       ora.eons.typeONLINE    ONLINE    node1
  ora.gsd      ora.gsd.type   OFFLINE   OFFLINE
  ora....network ora....rk.type ONLINE    ONLINE    node1
  ora....SM1.asm application    ONLINE    ONLINE    node1
  ora....E1.lsnr application    OFFLINE   OFFLINE
  ora.node1.gsdapplication    OFFLINE   OFFLINE
  ora.node1.onsapplication    ONLINE    ONLINE    node1
  ora.node1.vipora....t1.type OFFLINE   OFFLINE
  ora....SM2.asm application    ONLINE    ONLINE    node2
  ora....E2.lsnr application    OFFLINE   OFFLINE
  ora.node2.gsdapplication    OFFLINE   OFFLINE
  ora.node2.onsapplication    ONLINE    ONLINE    node2
  ora.node2.vipora....t1.type OFFLINE   OFFLINE
  ora.oc4j       ora.oc4j.typeOFFLINE   OFFLINE
  ora.ons      ora.ons.type   ONLINE    ONLINE    node1
  ora.prod.db    ora....se.type OFFLINE   OFFLINE
  ora....taf.svc ora....ce.type OFFLINE   OFFLINE
  ora....ry.acfs ora....fs.type ONLINE    ONLINE    node1
  ora.scan1.vipora....ip.type OFFLINE   OFFLINE
  rac_web      application    ONLINE    ONLINE    node1
  web_vip      application    ONLINE    ONLINE    node1
  四、通过oifcfg 工具修改ip
  [root@node1 ~]# oifcfg
  Name:
  oifcfg - Oracle Interface Configuration Tool.
  Usage:oifcfg iflist [-p [-n]]
  oifcfg setif {-node| -global} {/:}...
  oifcfg getif [-node| -global] [ -if [/] [-type ] ]
  oifcfg delif [{-node| -global} [[/]]]
  oifcfg [-help]
   - name of the host, as known to a communications network
  - name by which the interface is configured in the system
     - subnet address of the interface
  - type of the interface { cluster_interconnect | public }
  # oifcfg iflist
  eth0192.168.8.0
  eth110.10.10.0
  # oifcfg iflist -p
  eth0192.168.8.0PRIVATE
  eth110.10.10.0PRIVATE
  # oifcfg iflist -p -n
  eth0192.168.8.0PRIVATE255.255.255.0
  eth110.10.10.0PRIVATE255.255.255.0
  [root@node1 ~]# oifcfg getif -global
  eth0192.168.8.0globalpublic
  eth110.10.10.0globalcluster_interconnect
  删除原来的网卡ip 配置信息
  [root@node1 ~]# oifcfg delif
  # oifcfg getif
  # oifcfg getif -global
  重新配置网卡ip信息
  [root@node1 ~]# oifcfg setif -global eth0/192.168.8.0:public
  # oifcfg getif
  eth0192.168.8.0globalpublic
  # oifcfg setif -global eth1/10.10.10.0:cluster_interconnect
  # oifcfg getif -global
  eth0192.168.8.0globalpublic
  eth110.10.10.0globalcluster_interconnect
  # oifcfg iflist
  eth0192.168.8.0
  eth110.10.10.0
  # oifcfg iflist -p -n
  eth0192.168.8.0PRIVATE255.255.255.0
  eth110.10.10.0PRIVATE255.255.255.0
  查看并重新配置VIP
  # srvctl config vip -n node1
  VIP exists.:node1
  VIP exists.: /node1-vip/192.168.8.113/255.255.255.0/eth0
  # srvctl config vip -n node2
  VIP exists.:node2
  VIP exists.: /node2-vip/192.168.8.114/255.255.255.0/eth0
  # clear
  # srvctl modify nodeapps -h
  Modifies the configuration for a node application.
  Usage: srvctl modify nodeapps {[-n-A /]] | [-S /]]} [-m ] [-p ] [-e ] [ -l] [-r] [-t [:][,[:]...]] [-v]
  -A             Node level Virtual IP address
  -S //]NET address spec for network
  -m    The multicast IP address for eONS
  -p   The port number for eONS
  -e      Local listen port for eONS daemon (Default port number is 2016)
  -l       ONS listening port for local client connections
  -r      ONS listening port for connections from remote hosts
  -t [:][,[:]...]List of remote host/port pairs for ONS daemons outside this cluster
  -h                     Print usage
  -v                     Verbose output
  # srvctl modify nodeapps -A 192.168.8.113/255.255.255.0/eth0 -n node1
  # srvctl modify nodeapps -A 192.168.8.114/255.255.255.0/eth0 -n node2
  # srvctl config vip -n node1
  VIP exists.:node1
  VIP exists.: /node1-vip/192.168.8.113/255.255.255.0/eth0
  # srvctl config vip -n node2
  VIP exists.:node2
  VIP exists.: /node2-vip/192.168.8.114/255.255.255.0/eth0
  查看并重新配置SCAN:
  # srvctl config scan
  SCAN name: rac_scan, Network: 1/192.168.8.0/255.255.255.0/eth0
  SCAN VIP name: scan1, IP: /192.168.8.15/192.168.8.15
  # srvctl modify scan -h
  Modifies the SCAN name.
  Usage: srvctl modify scan -n
  -n            Domain name qualified SCAN name
  -h                     Print usage
  # srvctl modify scan -n rac_scan
  # srvctl config scan
  SCAN name: rac_scan, Network: 1/192.168.8.0/255.255.255.0/eth0
  SCAN VIP name: scan1, IP: /rac_scan/192.168.8.115
  #
  如果需要修改private ip ,同样可用oifcfg 配置eth1网卡即可!
  五、配置完成,启动相关的服务和resource
  启动VIP、监听、scan和scan_listener、数据库
  # srvctl enable listener
  # srvctl enable vip -i "node1-vip"
  # srvctl enable vip -i "node2-vip"
  # srvctl enable scan_listener
  # srvctl enable scan
  # srvctl enable database -d prod
  # srvctl start listener
  # srvctl start vip -n node1,node2
  [# srvctl start scan_listener
  # srvctl start scan
  # srvctl start database -d prod
  

页: [1]
查看完整版本: Oracle 11g RAC 修改IP