【RAC】修改public IP&VIP

好久没更新了,今天来一发,就写下最近做的一个操作,修改11g RAC的public ip 以及 virtual ip,命令同样适用于10g。

一.IP 信息

IP地址

IP地址

说明

192.168.131.11

192.168.130.11

scan ip

192.168.131.13

192.168.130.12

public ip

192.168.131.14

192.168.130.13

public ip

192.168.131.23

192.168.130.14

virtual ip

192.168.131.24

192.168.130.15

virtual ip

 

二. OS层面网络配置

2.1. 查看网卡设备信息

--aix

ifconfig -a

lsattr -El en1

以上为AIX的命令


linux可以用以下命令查看:

ifconfig

more /etc/sysconfig/network-scripts/ifcfg-eth0

 

db1:[/]#ifconfig -a

en1:flags=5e080863,18c0

        inet 10.10.130.130 netmask 0xffffff00broadcast 10.10.10.255

         tcp_sendspace 131072 tcp_recvspace65536 rfc1323 1

en5:flags=5e080863,18c0

        inet 10.10.10.130 netmask 0xffffff00broadcast 10.10.131.255

         tcp_sendspace 131072 tcp_recvspace65536 rfc1323 1

en9: flags=5e080863,18c0

        inet 192.168.131.13netmask 0xffffff00 broadcast 192.168.131.255

         tcp_sendspace 131072 tcp_recvspace65536 rfc1323 0

lo0:flags=e08084b,c0

        inet 127.0.0.1 netmask 0xff000000broadcast 127.255.255.255

        inet6 ::1%1/0

         tcp_sendspace 131072 tcp_recvspace131072 rfc1323 1

 

db1:[/]#lsattr -El en9

alias4                       IPv4 Alias includingSubnet Mask              True

alias6                       IPv6 Alias includingPrefix Length            True

arp           on             Address Resolution Protocol(ARP)             True

authority                    Authorized Users                              True

broadcast                    Broadcast Address                             True

monitor       off            Enable/Disable monitor for virtualEthernet   True

mtu           1500           Maximum IP Packet Size for ThisDevice        True

mtu_bypass    off            Enable/Disable largesend forvirtual Ethernet True

netaddr       192.168.131.13Internet Address                             True

netaddr6                     IPv6 Internet Address                         True

netmask       255.255.255.0  Subnet Mask                                   True

prefixlen                    Prefix Length for IPv6Internet Address       True

remmtu        576            Maximum IP Packet Size for REMOTENetworks    True

rfc1323                      Enable/Disable TCP RFC1323 Window Scaling    True

security      none           Security Level                                True

state         up             Current Interface Status                      True

tcp_mssdflt                  Set TCP Maximum SegmentSize                  True

tcp_nodelay                  Enable/Disable TCP_NODELAYOption             True

tcp_recvspace                Set Socket Buffer Space forReceiving         True

tcp_sendspace                Set Socket Buffer Space forSending           True

thread        off            Enable/Disable threadattribute               True

 

2.2.修改/etc/hosts (两个节点修改

$ vi /etc/hosts

127.0.0.1               loopback localhost      # loopback (lo0) name/address

::1                     loopback localhost      # IPv6 loopback (lo0) name/address

 

 

#PublicNetwork       -- en14

192.168.130.12 db1

192.168.130.13 db2

 

#PrivateInterconnect

10.10.131.130 db1-priv

10.10.131.136 db2-priv

 

#PublicVirtual IP (VIP) addresses

192.168.130.14 db1-vip

192.168.130.15 db2-vip

 

192.168.130.11 db-scan

 

三.修改GRID网络配置

3.1.启动CRS后台进程,仅保留crs的后台进程

先开启crs再关闭相关资源

# ./crsctlstart crs

--停止相关资源:

# srvctl stopdatabase -d db

# srvctl stoplistener

# srvctl stopscan_listener

# srvctl stopscan

# srvctl stopcvu

# srvctl stopnodeapps -n db1

# srvctl stopnodeapps -n db2

 

--检查资源状态:

# crs_stat -t

Name           Type           Target    State    Host       

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

ora.DATA.dg   ora....up.type ONLINE   ONLINE    rac1       

ora.FRA.dg    ora....up.type ONLINE   ONLINE    rac1       

ora....ER.lsnrora....er.type OFFLINE   OFFLINE              

ora....N1.lsnrora....er.type OFFLINE   OFFLINE              

ora....TING.dg ora....up.type ONLINE    ONLINE   rac1       

ora.asm       ora.asm.type   ONLINE    ONLINE   rac1       

ora.cvu        ora.cvu.type   OFFLINE  OFFLINE              

ora.dave.db    ora....se.type ONLINE    OFFLINE              

ora....taf.svcora....ce.type OFFLINE   OFFLINE              

ora.gsd        ora.gsd.type   OFFLINE  OFFLINE              

ora....networkora....rk.type OFFLINE   OFFLINE              

ora.oc4j      ora.oc4j.type  ONLINE    ONLINE   rac2       

ora.ons        ora.ons.type   OFFLINE  OFFLINE              

ora....SM1.asm application   ONLINE    ONLINE    rac1       

ora....C1.lsnrapplication    OFFLINE   OFFLINE              

ora.rac1.gsd   application    OFFLINE  OFFLINE               

ora.rac1.ons   application    OFFLINE  OFFLINE              

ora.rac1.vip   ora....t1.type OFFLINE   OFFLINE              

ora....SM2.asm application   ONLINE    ONLINE    rac2       

ora....C2.lsnrapplication    OFFLINE   OFFLINE               

ora.rac2.gsd   application    OFFLINE OFFLINE              

ora.rac2.ons   application    OFFLINE  OFFLINE              

ora.rac2.vip   ora....t1.type OFFLINE   OFFLINE              

ora.rac3.vip   ora....t1.type OFFLINE   OFFLINE              

ora.scan1.vip  ora....ip.type OFFLINE   OFFLINE              

注:因为11g的RAC使用ASM来存放OCR和Votingdisk , 所以要修改相关的配置信息,就不能停止ASM实例。

具体的CRS的后台进程可以通过如下命令查看:crsctl stat res -t -init

 

3.2.修改publicIP(只需在一个节点上操作即可)

按新情况在主机层面修改网络(AIX系统需要注意

l  注意打开rfc1323参数  (=1)

no -a |fgrep rfc1323

lsattr -El en14

lsattr -El en9

 

no -o -prfc1323=1

 

--查看配置:

$  oifcfg getif -global

en5  10.10.10.0 global  cluster_interconnect

en9  192.168.131.0  global public

en1  10.10.130.0 global  cluster_interconnect

 

# oifcfg delif-global en9

$ oifcfg setif-global en9/192.168.130.0:public

 

--确认

$ oifcfg getif-global

 

3.3.修改VIP(只需在一个节点上操作即可)

--查看VIP 信息

# srvctlconfig nodeapps -a

 

--验证VIP的状态:

$ crsctl statres -t

--确保相关资源已经offline,如果没有,手工stop一下:

$ srvctl stopinstance -d DB -n db1

$ srvctl stopvip -n db1 -f

 

--用root用户修改VIP 信息

# ./srvctlmodify nodeapps -n db1 -A 192.168.130.14/255.255.255.0/en14

# ./srvctlmodify nodeapps -n db2 -A 192.168.130.15/255.255.255.0/en14

 

--验证

# srvctlconfig nodeapps -a

 

3.4.修改SCANIP(只需在一个节点上操作即可)

--查看scan状态:

$ srvctlconfig scan

scan可不改,会自动修改。

若没有自动修改,可参照以下步骤手动修改:

 

--准备修改,关闭相关服务:

$srvctl stopscan_listener

$srvctl stopscan

$srvctl statusscan

 

--用root进行修改:

# ./srvctlmodify scan -n db-scan

 

--检查修改结果:

# srvctlconfig scan

注意:与修改private ip,vip 不一样,修改scan ip 无需停止数据库实例,asm或者重启crs,相对比较简单。

 

3.5.重启clusterware(所有节点root执行

--停止crs

# crsctl stopcrs

在所有节点执行。

 

--启动crs

# crsctl startcrs

 

3.6.检查所有进程的状态

# srvctl startlistener

# srvctl startscan

# srvctl startscan_listener

# srvctl startcvu

 

# ./crs_stat-t

 

3.7.修改tnsnames.ora

vi $ORACLE_HOME/network/admin/tnsnames.ora

 



参考文档:

How to Modify Private NetworkInformation in Oracle Clusterware (文档ID 283684.1)

How to Modify Public NetworkInformation including VIP in Oracle Clusterware (文档ID 276434.1)

 

 

 

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

转载须注明出处!

http://blog.csdn.net/sharqueen_wu/article/details/51314226

 

转载须注明出处!

http://blog.csdn.net/sharqueen_wu/article/details/51314226

 

转载须注明出处!

http://blog.csdn.net/sharqueen_wu/article/details/51314226

 


你可能感兴趣的:(ORACLE,RAC,oracle,11g)