您的位置:首页 > 其它

修改10G RAC public IP && VIP

2014-06-23 12:30 344 查看
一、场景:因服务器的网络变更,所有ip地址需要重新分配,oracle RAC下的ip地址就需要做相关的修改,这里需要对public ip地址及VIP地址做修改,至于心跳ip地址,还是延续使用原先的ip地址;

二、IP地址:

1、原先ip地址分配

node1==>

[oracle@trsen01 ~]$ more /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1        localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

10.1.198.151     trsen01

10.1.198.152     trsen02

192.168.10.151   trsen01-priv

192.168.10.152   trsen02-priv

10.1.198.153    trsen01-vip

10.1.198.154    trsen02-vip

node2===>

[oracle@trsen02 ~]$ more /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1        localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

10.1.198.151     trsen01

10.1.198.152     trsen02

192.168.10.151   trsen01-priv

192.168.10.152   trsen02-priv

10.1.198.153    trsen01-vip

10.1.198.154    trsen02-vip

2、现有IP地址分配

node1===>

[oracle@trsen01 ~]$ more /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1        localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

192.168.10.151  trsen01-priv

192.168.10.152  trsen02-priv

10.109.199.171  trsen01-vip

10.109.199.172  trsen02-vip

10.109.199.133  trsen01

10.109.199.134  trsen02

node2==>

[oracle@trsen02 ~]$ more /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1        localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

192.168.10.151  trsen01-priv

192.168.10.152  trsen02-priv

10.109.199.171  trsen01-vip

10.109.199.172    trsen02-vip

10.109.199.133  trsen01
10.109.199.134  trsen02

三、注意事项:

1、注意网卡的mac地址与ip地址相对应(这里,我不确认,如果换了网卡是否可以,但是从crs的配置文件及mos文档里没有提到相关信息);

2、在修改前后,应用最好可以切到临时库上或对数据做个可还原的备份;这里选择切至临时库,因为数据库较大,做个备份较慢;

四、相关知识点

oifcfg==>oracle接口配置工具

[oracle@trsen01 ~]$ oifcfg -help

Name:

        oifcfg - Oracle Interface Configuration Tool.

Usage:  oifcfg iflist [-p [-n]]

        oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...

        oifcfg getif [-node <nodename> | -global] [ -if <if_name>[/<subnet>] [-type <if_type>] ]

        oifcfg delif [-node <nodename> | -global] [<if_name>[/<subnet>]]

        oifcfg [-help]

        <nodename> - name of the host, as known to a communications network

        <if_name>  - name by which the interface is configured in the system

        <subnet>   - subnet address of the interface

        <if_type>  - type of the interface { cluster_interconnect | public | storage }

==>nodename:节点名;if_name:网卡接口名;subnet:网卡接口子网地址;

五、操作

=================================

public IP子网地址信息修改脚本

=================================

1、查看public ip地址及心跳地址的

[oracle@trsen01 ~]$ oifcfg getif

eth2  10.1.198.0  global  public

eth3  192.168.10.0  global  cluster_interconnect

[oracle@trsen02 ~]$ oifcfg getif

eth2  10.1.198.0  global  public

eth3  192.168.10.0  global  cluster_interconnect

这里子网地址信息变更

10.1.198.0==>10.109.199.0

变更命令如下

% $CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>]

% $CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:public

信息修改==>

$ORA_CRS_HOME/bin/oifcfg delif -global eth2/10.1.198.0

$ORA_CRS_HOME/bin/oifcfg setif -global eth2/10.109.199.0:public

===========================================

VIP 地址信息修改脚本

===========================================

1、查看VIP的配置信息

[oracle@trsen01 ~]$ srvctl config nodeapps -n trsen01 -a

VIP exists.: /trsen01-vip/10.1.198.153/255.255.255.0/eth2

[oracle@trsen02 ~]$ srvctl  config nodeapps -n trsen02 -a

VIP exists.: /trsen02-vip/10.1.198.154/255.255.255.0/eth2

2、查看crs的状态

[oracle@trsen01 ~]$ crs_stat -t

Name           Type           Target    State     Host        

------------------------------------------------------------

ora....SM1.asm application    ONLINE    ONLINE    trsen01       

ora....01.lsnr application    ONLINE    ONLINE    trsen01       

ora.gps01.gsd  application    ONLINE    ONLINE    trsen01       

ora.gps01.ons  application    ONLINE    ONLINE    trsen01       

ora.gps01.vip  application    ONLINE    ONLINE    trsen01       

ora....SM2.asm application    ONLINE    ONLINE    trsen02       

ora....02.lsnr application    ONLINE    ONLINE    trsen02       

ora.gps02.gsd  application    ONLINE    ONLINE    trsen02       

ora.gps02.ons  application    ONLINE    ONLINE    trsen02       

ora.gps02.vip  application    ONLINE    ONLINE    trsen02       

ora.gpsdb.db   application    ONLINE    ONLINE    trsen01       

ora.....gps.cs application    OFFLINE   OFFLINE               

ora....db1.srv application    OFFLINE   OFFLINE       

ora....b1.inst application    ONLINE    ONLINE    trsen01       

ora....b2.inst application    ONLINE    ONLINE    trsen02

3、停止数据库及ASM实例

$ srvctl stop instance -d <db_name> -i <inst_name> (对于 10.2.0.3 及以上版本,可以忽略)

$ srvctl stop asm -n <node_name> (对于 10.2.0.3 及以上版本,可以忽略)

$ srvctl stop nodeapps -n <node_name>

==>数据库实例及ASM实例及VIP资源的停止脚本

srvctl stop instance -d gpsdb  -i trsendb1

srvctl stop instance -d gpsdb  -i trsendb2

srvctl stop asm -n trsen01

srvctl stop asm -n trsen02

srvctl stop nodeapps -n trsen01

srvctl stop nodeapps -n trsen02

4、使用root用户修改 VIP 资源

这里10.1.198.153==>10.109.199.171

这里10.1.198.154==>10.109.199.172

# srvctl modify nodeapps -n <node> -A <new_vip_address or new_vip_hostname>/<netmask>/<[if1[if2...]]>

例如:

# srvctl modify nodeapps -n racnode1 -A racnode1-nvip/255.255.255.0/eth2

===>修改脚本

 /opt/app/oracle/product/10.2.0/crs_1/bin/srvctl modify nodeapps -n trsen01 -A 10.109.199.171/255.255.255.0/eth2

 /opt/app/oracle/product/10.2.0/crs_1/bin/srvctl modify nodeapps -n trsen02 -A 10.109.199.172/255.255.255.0/eth2

 

5、启动相关实例及资源

srvctl start instance -d trsendb  -i trsendb1

srvctl start instance -d trsendb  -i trsendb2

srvctl start asm -n trsen01

srvctl start asm -n trsen02

srvctl start nodeapps -n trsen01

srvctl start nodeapps -n trsen02

===========================

相关交流信息

QQ群: 330218614

Email: 623009431@qq.com

Blog: http://blog.csdn.net/trsenzhang
============================
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: