rac 改public 及vip IP---備份01

tom_xieym發表於2011-06-20

10g rac 改public 及vip IP
環境:
OS:Red Hat Linux AS4
DB:10gR2 RAC
測試內容:
RAC1上:
公網IP由:
134.96.39.188      rac1
更改為:
134.98.83.58      rac1
VIP地址由:
134.96.39.186        rac1-vip
更改為
134.98.83.242        rac1-vip
RAC2上:
公網IP由:
134.96.39.189       rac2
更改為:
134.98.83.59        rac2
VIP地址由:
134.96.39.187           rac2-vip
更改為:
134.98.83.243       rac2-vip
1、停CRS
[oracle@rac1 bin]$ crs_stat -t
Name          Type          Target   State    Host
------------------------------------------------------------
ora....SM1.asm application   ONLINE   ONLINE   rac1
ora....C1.lsnr application   ONLINE   ONLINE   rac1
ora.rac1.gsd  application   ONLINE   ONLINE   rac1
ora.rac1.ons  application   ONLINE   ONLINE   rac1
ora.rac1.vip  application   ONLINE   ONLINE   rac1
ora....SM2.asm application   ONLINE   ONLINE   rac2
ora....C2.lsnr application   ONLINE   ONLINE   rac2
ora.rac2.gsd  application   ONLINE   ONLINE   rac2
ora.rac2.ons  application   ONLINE   ONLINE   rac2
ora.rac2.vip  application   ONLINE   ONLINE   rac2
ora.sky.db    application   ONLINE   ONLINE   rac2
ora....y1.inst application   ONLINE   ONLINE   rac1
ora....y2.inst application   ONLINE   ONLINE   rac2
[oracle@rac1 bin]$ crs_stop -all
Attempting to stop `ora.rac1.gsd` on member `rac1`
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.rac1.gsd` on member `rac1` succeeded.
Attempting to stop `ora.rac2.ons` on member `rac2`
Attempting to stop `ora.rac1.ons` on member `rac1`
Attempting to stop `ora.sky.db` on member `rac2`
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
Stop of `ora.rac2.ons` on member `rac2` succeeded.
Stop of `ora.rac1.ons` on member `rac1` succeeded.
Stop of `ora.sky.db` on member `rac2` succeeded.
`ora.racdb.racdb1.inst` is already OFFLINE.
`ora.racdb.racdb2.inst` is already OFFLINE.
Attempting to stop `ora.rac1.ASM1.asm` on member `rac1`
Attempting to stop `ora.rac2.ASM2.asm` on member `rac2`
Stop of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
Attempting to stop `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
Stop of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
Attempting to stop `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Stop of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
Stop of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
Attempting to stop `ora.rac1.vip` on member `rac1`
Attempting to stop `ora.rac2.vip` on member `rac2`
Stop of `ora.rac2.vip` on member `rac2` succeeded.
Stop of `ora.rac1.vip` on member `rac1` succeeded.
CRS-0216: Could not stop resource 'ora.sky.sky1.inst'.
CRS-0216: Could not stop resource 'ora.sky.sky2.inst'.
[oracle@rac1 bin]$ ps -ef|grep pmon
oracle  30354 21199 0 14:01 pts/3   00:00:00 grep pmon
[oracle@rac1 bin]$
2、修改兩臺機器的/etc/hosts檔案
以下是修改後的結果:
[oracle@rac1 ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1      localhost
134.98.83.57   rac1.oraclefocus.com   rac1
134.98.83.242  rac1-vip.oraclefocus.com       rac1-vip
#10.1.9.212   rac1.oraclefocus.com   rac1
#10.1.9.242   rac1-vip.oraclefocus.com       rac1-vip
10.10.10.31    rac1-priv.oraclefocus.com      rac1-priv
134.98.83.58   rac2.oraclefocus.com   rac2
134.98.83.243  rac2-vip.oraclefocus.com       rac2-vip
#10.1.9.213   rac2.oraclefocus.com   rac2
#10.1.9.243   rac2-vip.oraclefocus.com       rac2-vip
10.10.10.32    rac2-priv.oraclefocus.com      rac2-priv
3、修改listener.ora檔案
4、在系統設定中修改網路卡eth0的IP,子網掩碼,閘道器,並重新啟用
以RCA1上為例,將eth0的相關IP更改如下
原:IP:10.1.9.212   子網掩碼:255.255.255.0   閘道器:10.1.9.1
新:IP:134.98.83.57 子網掩碼:255.255.255.224 閘道器:134.98.83.1
這裡需要注意,若原eht1無子網掩碼,需要加上,設成:10.10.10.1,否則一些CRS服務無法啟動
開始沒有加上,發現只有少數幾個起來了,加上後就可以正常啟動了
5、更改PUBLIC網路卡設定
以ROOT使用者執行
[root@rac1 bin]# pwd
/u01/app/oracle/product/10.2.0/crs_1/bin
[root@rac1 bin]#
[root@rac1 bin]# ./oifcfg getif
eth0 10.1.9.0 global public
eth1 10.10.10.0 global cluster_interconnect
[root@rac1 bin]#
5.1刪除原的PUBLIC網路卡設定
[root@rac1 bin]# ./oifcfg delif -global eth0
[root@rac1 bin]# ./oifcfg getif
eth1 10.10.10.0 global cluster_interconnect
[root@rac1 bin]#
5.2設定新PUBLIC網路卡地址
[root@rac1 bin]# ./oifcfg setif -global eth0/134.98.83.0:public
[root@rac1 bin]# ./oifcfg getif
eth0 134.98.83.0 global public
eth1 10.10.10.0 global cluster_interconnect
[root@rac1 bin]#
6、更改VIP配置
在兩個節點上分別執行:
[root@rac1 bin]# ./srvctl modify nodeapps -n rac1 -A 134.98.83.242/255.255.255.224/eth0
[root@rac1 bin]# ./srvctl modify nodeapps -n rac2 -A 134.98.83.233/255.255.255.224/eth0
7、重啟CRS
[root@rac1 bin]# ./crs_start -all
[root@rac1 bin]# ./crs_stat -t
Name          Type          Target   State    Host
------------------------------------------------------------
ora....SM1.asm application   ONLINE   ONLINE   rac1
ora....C1.lsnr application   ONLINE   ONLINE   rac1
ora.rac1.gsd  application   ONLINE   ONLINE   rac1
ora.rac1.ons  application   ONLINE   ONLINE   rac1
ora.rac1.vip  application   ONLINE   ONLINE   rac1
ora....SM2.asm application   ONLINE   ONLINE   rac2
ora....C2.lsnr application   ONLINE   ONLINE   rac2
ora.rac2.gsd  application   ONLINE   ONLINE   rac2
ora.rac2.ons  application   ONLINE   ONLINE   rac2
ora.rac2.vip  application   ONLINE   ONLINE   rac2
ora.racdb.db    application   ONLINE   ONLINE   rac2
ora....d1.inst application   ONLINE   ONLINE   rac1
ora....d2.inst application   ONLINE   ONLINE   rac2

[root@rac1 bin]# ps -ef|grep pmon
oracle  25377    1 0 16:46 ?       00:00:04 asm_pmon_+ASM1
oracle  25980    1 0 16:47 ?       00:00:04 ora_pmon_racdb1
root    12077 28069 0 17:41 pts/3   00:00:00 grep pmon

[root@rac2 bin]# ps -ef|grep pmon
oracle  31746    1 0 17:14 ?       00:00:02 asm_pmon_+ASM2
oracle   7051    1 0 17:22 ?       00:00:02 ora_pmon_racdb2
root    24145 24109 0 17:41 pts/3   00:00:00 grep pmon
至此,IP修改完成

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25850100/viewspace-700245/,如需轉載,請註明出處,否則將追究法律責任。

相關文章