ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 10g rac 改public 及vip IP

10g rac 改public 及vip IP

原创 Linux操作系统 作者:zengzg 时间:2019-07-12 11:09:06 0 删除 编辑

   今天试了一下在10g rac下改IP,下文为wj整理的:

环境:

OSRed Hat Linux AS4

DB10gR2 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、在系统设置中修改网卡eth0IP,子网掩码,网关,并重新激活

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.232/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修改完成

 

 

8、参考文档

Metalink: Note:283684.1

Metalink: Note:276434.1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10834762/viewspace-468389/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-09-09

  • 博文量
    50
  • 访问量
    38792