设为首页 收藏本站
查看: 701|回复: 0

[经验分享] Oracle 11g RAC 修改IP

[复制链接]

尚未签到

发表于 2018-9-12 11:55:06 | 显示全部楼层 |阅读模式
  Oracle 11g RAC 修改IP
  
  在RAC环境下修改ip地址,会造成数据库停机,所以在搭建、配置RAC前,必须做好ip规划,而主机名是不允许修改的,如果修改必须重新安装CRS.
  系统环境:
  操作系统:RedHat EL5.5
  集群软件: GI 11G
  数据库软件:Oracle 11.2.0.1
  
  
  修改ip 方法:
  一、禁用和停止相关的resource
  
  1)禁用和停止 vip service
  [root@node1 ~]# 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
  [root@node1 ~]# srvctl disable vip -i "node1-vip"
  [root@node1 ~]# srvctl disable vip -i "node2-vip"
  
  [root@node1 ~]# 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
  [root@node1 ~]# srvctl stop vip -n node1
  [root@node1 ~]# srvctl stop vip -n node2
  2)禁用和停止listener
  [root@node1 ~]# srvctl disable listener
  [root@node1 ~]# srvctl stop listener
  3)禁用和停止scan及scan_listener
  [root@node1 ~]# srvctl disable scan_listener
  [root@node1 ~]# srvctl stop scan_listener
  [root@node1 ~]# srvctl disable scan
  [root@node1 ~]# srvctl stop scan
  [root@node1 ~]#
  4)在所有节点停止CRS 服务
  [root@node1 ~]# 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(所有节点)
  [root@node1 ~]# 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.11  node1
  192.168.8.13  node1-vip
  10.10.10.11  node1-priv
  192.168.8.12  node2
  192.168.8.14  node2-vip
  10.10.10.12   node2-priv
  192.168.8.15   rac_scan
  [root@node1 ~]# 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.111  node1
  192.168.8.113  node1-vip
  10.10.10.11  node1-priv
  192.168.8.112  node2
  192.168.8.114  node2-vip
  10.10.10.12   node2-priv
  192.168.8.115   rac_scan
  ~
  [root@node1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
  三、重新启动CRS 服务
  [root@node1 ~]# crsctl start crs
  CRS-4123: Oracle High Availability Services has been started.
  [root@node1 ~]# 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
  被禁用服务未启动
  [root@node1 ~]# 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.type  ONLINE    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.gsd  application    OFFLINE   OFFLINE
  ora.node1.ons  application    ONLINE    ONLINE    node1
  ora.node1.vip  ora....t1.type OFFLINE   OFFLINE
  ora....SM2.asm application    ONLINE    ONLINE    node2
  ora....E2.lsnr application    OFFLINE   OFFLINE
  ora.node2.gsd  application    OFFLINE   OFFLINE
  ora.node2.ons  application    ONLINE    ONLINE    node2
  ora.node2.vip  ora....t1.type OFFLINE   OFFLINE
  ora.oc4j       ora.oc4j.type  OFFLINE   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.vip  ora....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 }
  [root@node1 ~]# oifcfg iflist
  eth0  192.168.8.0
  eth1  10.10.10.0
  [root@node1 ~]# oifcfg iflist -p
  eth0  192.168.8.0  PRIVATE
  eth1  10.10.10.0  PRIVATE
  [root@node1 ~]# oifcfg iflist -p -n
  eth0  192.168.8.0  PRIVATE  255.255.255.0
  eth1  10.10.10.0  PRIVATE  255.255.255.0
  [root@node1 ~]# oifcfg getif -global
  eth0  192.168.8.0  global  public
  eth1  10.10.10.0  global  cluster_interconnect
  删除原来的网卡ip 配置信息
  [root@node1 ~]# oifcfg delif
  [root@node1 ~]# oifcfg getif
  [root@node1 ~]# oifcfg getif -global
  重新配置网卡ip信息
  [root@node1 ~]# oifcfg setif -global eth0/192.168.8.0:public
  [root@node1 ~]# oifcfg getif
  eth0  192.168.8.0  global  public
  [root@node1 ~]# oifcfg setif -global eth1/10.10.10.0:cluster_interconnect
  [root@node1 ~]# oifcfg getif -global
  eth0  192.168.8.0  global  public
  eth1  10.10.10.0  global  cluster_interconnect
  [root@node1 ~]# oifcfg iflist
  eth0  192.168.8.0
  eth1  10.10.10.0
  [root@node1 ~]# oifcfg iflist -p -n
  eth0  192.168.8.0  PRIVATE  255.255.255.0
  eth1  10.10.10.0  PRIVATE  255.255.255.0
  查看并重新配置VIP
  [root@node1 ~]# srvctl config vip -n node1
  VIP exists.:node1
  VIP exists.: /node1-vip/192.168.8.113/255.255.255.0/eth0
  [root@node1 ~]# srvctl config vip -n node2
  VIP exists.:node2
  VIP exists.: /node2-vip/192.168.8.114/255.255.255.0/eth0
  [root@node1 ~]# clear
  [root@node1 ~]# srvctl modify nodeapps -h
  Modifies the configuration for a node application.
  Usage: srvctl modify nodeapps {[-n  -A /[/if1[|if2|...]]] | [-S /[/if1[|if2|...]]]} [-m ] [-p ] [-e ] [ -l  ] [-r  ] [-t [:][,[:]...]] [-v]
  -A             Node level Virtual IP address
  -S //[if1[|if2...]]  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
  [root@node1 ~]# srvctl modify nodeapps -A 192.168.8.113/255.255.255.0/eth0 -n node1
  [root@node1 ~]# srvctl modify nodeapps -A 192.168.8.114/255.255.255.0/eth0 -n node2
  [root@node1 ~]# srvctl config vip -n node1
  VIP exists.:node1
  VIP exists.: /node1-vip/192.168.8.113/255.255.255.0/eth0
  [root@node1 ~]# srvctl config vip -n node2
  VIP exists.:node2
  VIP exists.: /node2-vip/192.168.8.114/255.255.255.0/eth0
  查看并重新配置SCAN:
  [root@node1 ~]# 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
  [root@node1 ~]# srvctl modify scan -h
  Modifies the SCAN name.
  Usage: srvctl modify scan -n
  -n            Domain name qualified SCAN name
  -h                       Print usage
  [root@node1 ~]# srvctl modify scan -n rac_scan
  [root@node1 ~]# 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
  [root@node1 ~]#
  如果需要修改private ip ,同样可用oifcfg 配置eth1网卡即可!
  五、配置完成,启动相关的服务和resource
  启动VIP、监听、scan和scan_listener、数据库
  [root@node1 ~]# srvctl enable listener
  [root@node1 ~]# srvctl enable vip -i "node1-vip"
  [root@node1 ~]# srvctl enable vip -i "node2-vip"
  [root@node1 ~]# srvctl enable scan_listener
  [root@node1 ~]# srvctl enable scan
  [root@node1 ~]# srvctl enable database -d prod
  [root@node1 ~]# srvctl start listener
  [root@node1 ~]# srvctl start vip -n node1,node2
  [[root@node1 ~]# srvctl start scan_listener
  [root@node1 ~]# srvctl start scan
  [root@node1 ~]# srvctl start database -d prod
  


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-573323-1-1.html 上篇帖子: oracle 大内存需要配置hugepage 下篇帖子: ORACLE EXPDP命令使用详细
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表