更改rac的vip地址和集群互联地址.doc_第1页
更改rac的vip地址和集群互联地址.doc_第2页
更改rac的vip地址和集群互联地址.doc_第3页
更改rac的vip地址和集群互联地址.doc_第4页
更改rac的vip地址和集群互联地址.doc_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

今天准备打开我的debian下的oracle 10gR2来做一些java测试, 可是忘记了上次关机以来我的网络以及vmware都做了调整, 竟然无法直接访问. 就想把debian虚拟机使用的ip地址给改改. 主机名及修改前后的ip地址如下:主机名 修改前的ip地址 修改后的ip地址 作用rac1 192.168.0.181 192.168.1.181 rac1 eth0 native iprac2 192.168.0.182 192.168.1.182 rac2 eth0 native iprac1-vip 192.168.0.191 192.168.1.191 rac1 viprac2-vip 192.168.0.192 192.168.1.192 rac2 viprac1-priv 10.10.10.181 10.1.0.181 rac1 eth1 ip interconnrac2-priv 10.10.10.182 10.1.0.182 rac2 eth1 ip interconn思路如下, 停止所有oracle相关的进程, 然后修改操作系统的ip设置, 修改与oracle相关的ip地址的设定, 启动crs及相关服务.具体操作步骤如下:1 停止oracle相关的所有进程, 包括数据库, asm, node application, crs本身.1.1 查看当前系统上crs运行的状态oraclerac2:/u01/app/oracle/product/10.2.0/crs/bin$ ./crs_statNAME=ora.orcl.dbTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.orcl.orcl1.instTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.orcl.orcl2.instTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac1.ASM1.asmTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.LISTENER_RAC1.lsnrTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.gsdTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.onsTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.vipTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac2.ASM2.asmTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.LISTENER_RAC2.lsnrTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.gsdTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.onsTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.vipTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac21.2 关闭数据库oraclerac2:/u01/app/oracle/product/10.2.0/crs/bin$ srvctl stop database -d orcl1.3 关闭asm实例oraclerac2:/u01/app/oracle/product/10.2.0/crs/bin$ srvctl stop asm -n rac1oraclerac2:/u01/app/oracle/product/10.2.0/crs/bin$ srvctl stop asm -n rac21.4 关闭其他应用程序rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl stop nodeapps -n rac1rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl stop nodeapps -n rac21.5 关闭crs后台进程, 这一操作会在操作系统一级中止运行的crs后台进程, 必须在所有节点上运行.rac1:/u01/app/oracle/product/10.2.0/crs/bin# /etc/init.d/init.crs stopShutting down Oracle Cluster Ready Services (CRS):Stopping resources.Successfully stopped CRS resourcesStopping CSSD.Shutting down CSS daemon.Shutdown request successfully issued.Shutdown has begun. The daemons should exit soon.2 修改操作系统的ip设置debian的网络配置文件为/etc/network/interfaces和/etc/hosts, 其他linux发行版及unix网络配置文件位置可能并不一样. 以节点rac1为例, 修改前/etc/network/interfaces文件内容为:# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0 eth1iface eth0 inet staticaddress 192.168.0.181netmask 255.255.255.0network 192.168.0.0broadcast 192.168.0.255gateway 192.168.0.1# dns-* options are implemented by the resolvconf package, if installeddns-nameservers 202.106.0.20iface eth1 inet staticaddress 10.10.10.181netmask 255.255.255.0network 10.10.10.0broadcast 10.10.10.255修改后内容为:# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0 eth1iface eth0 inet staticaddress 192.168.1.181netmask 255.255.255.0network 192.168.1.0broadcast 192.168.1.255gateway 192.168.1.1# dns-* options are implemented by the resolvconf package, if installeddns-nameservers 202.106.0.20iface eth1 inet staticaddress 10.1.0.181netmask 255.255.255.0network 10.1.0.0broadcast 10.1.0.255/etc/hosts文件内容为:127.0.0.1 localhost.localdomain localhost192.168.0.181 rac1192.168.0.182 rac2192.168.0.191 rac1-vip192.168.0.192 rac2-vip10.10.10.181 rac1-priv10.10.10.182 rac2-priv# The following lines are desirable for IPv6 capable hosts:1 ip6-localhost ip6-loopbackfe00:0 ip6-localnetff00:0 ip6-mcastprefixff02:1 ip6-allnodesff02:2 ip6-allroutersff02:3 ip6-allhosts修改后:127.0.0.1 localhost.localdomain localhost192.168.1.181 rac1192.168.1.182 rac2192.168.1.191 rac1-vip192.168.1.192 rac2-vip10.1.0.181 rac1-priv10.1.0.182 rac2-priv# The following lines are desirable for IPv6 capable hosts:1 ip6-localhost ip6-loopbackfe00:0 ip6-localnetff00:0 ip6-mcastprefixff02:1 ip6-allnodesff02:2 ip6-allroutersff02:3 ip6-allhosts集群中所有节点的hosts文件应该保持一致./etc/network/interfaces和/etc/hosts文件修改后可使用/etc/init.d/networking restart或者重启操作系统使设置生效.3 启动crs, 设置oracle中ip地址相关的设置.3.1 启动crs, 并关闭随crs启动的应用程序rac1:/u01/app/oracle/product/10.2.0/db_1/network/admin# /etc/init.d/init.crs startStartup will be queued to init within 90 seconds.由于oracle所有应用设置为自动启动, 所以在crs启动时会试图启动所有的服务, 但是在对oracle相关的ip地址进行设置时需要crs处于运行状态而数据库, asm和node application处于停止状态, 所以需要我们参考1.2, 1.3, 1.4的内容关闭数据库, asm和node application.3.2 使用oifcfg修改网卡设置, oifconfig可以被用来设置和查看网卡被oracle使用的方式.rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg getif -globaleth0 192.168.0.0 global publiceth1 10.10.10.0 global cluster_interconnectrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg setif -global eth0/192.168.1.0:publicrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg iflisteth0 192.168.1.0eth0 192.168.0.0eth1 10.1.0.0rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg delif -global eth0/192.168.0.0rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg iflisteth0 192.168.1.0eth1 10.1.0.0rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg getif -globaleth0 192.168.1.0 global publiceth1 10.10.10.0 global cluster_interconnectrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./lifcfg setif -global eth1:/10.1.0.0:cluster_interconnect-bash: ./lifcfg: No such file or directoryrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg setif -global eth1:/10.1.0.0:cluster_interconnectrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg getif -globaleth0 192.168.1.0 global publiceth1 10.10.10.0 global cluster_interconnecteth1: 10.1.0.0 global cluster_interconnectrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg setif -global eth1/10.1.0.0:cluster_interconnectrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg getif -globaleth0 192.168.1.0 global publiceth1 10.10.10.0 global cluster_interconnecteth1 10.1.0.0 global cluster_interconnecteth1: 10.1.0.0 global cluster_interconnectrac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg delif -global eth1:rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg delif -global eth1/10.10.10.0rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./oifcfg getif -globaleth0 192.168.1.0 global publiceth1 10.1.0.0 global cluster_interconnectoifcfg iflist会显示当前使用的网卡及其子网设置, 而oifcfg getif -global 则会显示配置文件中的信息.3.3 修改vip地址rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl modify nodeapps -n rac1 -A 192.168.1.191/255.255.255.0/eth0rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl modify nodeapps -n rac2 -A 192.168.1.192/255.255.255.0/eth03.4 设置listener.ora和tnsnames.ora, 检查这些文件中是否有指定原来ip的地方, 修改为更改后的ip地址, 在rac1的配置文件中listener.ora包含了 192.168.0.181我修改成了192.168.1.181, rac2上的 listener.ora也做了相应的修改.3.5 启动node applications, asm, 数据库rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl start nodeapps -n rac1rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl start nodeapps -n rac2rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl start asm -n rac2rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl start asm -n rac1rac2:/u01/app/oracle/product/10.2.0/crs/bin#rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./srvctl start database -d orcl3.6 来看看我们的成果:rac2:/u01/app/oracle/product/10.2.0/crs/bin# ifconfig -aeth0 Link encap:Ethernet HWaddr 00:0C:29:0D:FE:0Finet addr:192.168.1.182 Bcast:192.168.1.255 Mask:255.255.255.0UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:142242 errors:0 dropped:0 overruns:0 frame:0TX packets:140057 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:83167889 (79.3 MiB) TX bytes:87987399 (83.9 MiB)Interrupt:19 Base address:0x1480eth0:1 Link encap:Ethernet HWaddr 00:0C:29:0D:FE:0Finet addr:192.168.1.192 Bcast:192.168.1.255 Mask:255.255.255.0UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1Interrupt:19 Base address:0x1480eth1 Link encap:Ethernet HWaddr 00:0C:29:0D:FE:19inet addr:10.1.0.182 Bcast:10.1.0.255 Mask:255.255.255.0UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:29781 errors:0 dropped:0 overruns:0 frame:0TX packets:26710 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:19667330 (18.7 MiB) TX bytes:11573375 (11.0 MiB)Interrupt:16 Base address:0x1800lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0UP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:21796 errors:0 dropped:0 overruns:0 frame:0TX packets:21796 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:6238339 (5.9 MiB) TX bytes:6238339 (5.9 MiB)rac2:/u01/app/oracle/product/10.2.0/crs/bin# ./crs_statNAME=ora.orcl.dbTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.orcl.orcl1.instTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.orcl.orcl2.instTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac1.ASM1.asmTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.LISTENER_RAC1.lsnrTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.gsdTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.onsTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac1.vipTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac1NAME=ora.rac2.ASM2.asmTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.LISTENER_RAC2.lsnrTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.gsdTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.onsTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2NAME=ora.rac2.vipTYPE=applicationTARGET=ONLINESTATE=ONLINE on rac2rac2:/u01/app/oracle/product/10.2.0/crs/bin# su - oracleoraclerac2:$ lsnrctl statLSNRCTL for Linux: Version 10.2.0.1.0 - Production on 23-AUG-2006 23:23:47Copyright (c) 1991, 2005, Oracle. All rights reserved.Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)STATUS of the LISTENER-Alias LISTENER_RAC2Version TNSLSNR for Linux: Version 10.2.0.1.0 - ProductionStart Date 23-AUG-2006 22:24:44Uptime 0 days 0 hr. 59 min. 3 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.oraListener Log File /u01/app/oracle/product/10.2.0/db_1/netwo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论