用srvctl modify nodeapps命令更改vip地址

转载自:http://space.itpub.net/7199859/viewspace-604545

Modify the VIP or VIP Hostname for a 10g Oracle Clusterware,有时候我们可能需要修改vip地址或对应的vip

主机名,而我这次在安装rac过程中,运行vipca时,把私有IP当成VIP来使用,导致在启动vip服务时启动不了

hosts里面内容如下:

[oracle@RAC1 ~]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost
138.30.0.101            rac1
138.30.0.102            rac2
138.30.0.201            rac1-vip
138.30.0.202            rac2-vip

100.100.1.1             rac1-priv
100.100.1.2             rac2-priv

在vipca安装过程中日志提示

2009-05-31 14:33:44.212: [    RACG][3067446976] [2411][3067446976][ora.rac1.vip]: IP:100.100.1.1 is already up in the network (host=RAC1)

[oracle@RAC1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    OFFLINE              
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    OFFLINE      

可以看到vip服务资源offline

从metalink上找到一篇文章,可以用srvctl工具来修改vip地址的,下面是具体测试过程

Changing VIP Addresses
Use the following procedure to change a VIP address:
1. Stop all database and ASM instances.
2. Stop the Listeners, and node applications using the srvctl stop nodeapps
command.
3. Run the following command to verify node connectivity between all of the nodes
for which your cluster is configured. This command discovers all of the network
interfaces available on the cluster nodes and verifies the connectivity between all
of the nodes by way of the discovered interfaces. This command also lists all of the
interfaces available on the nodes which are suitable for use as VIPs.
cluvfy comp nodecon -n all [-verbose]
4. Run the srvctl modify nodeapps command with the -A option as described
in Appendix E. Use the crs_stat command to identify all active node
applications.
5. Restart all of the instances and node applications that you stopped in Step 1 and 2.

[oracle@RAC1 ~]$ srvctl stop nodeapps -n rac1

[oracle@RAC1 ~]$ srvctl stop nodeapps -n rac2

[root@RAC1 bin]#./srvctl modify nodeapps -n rac1 -A 138.30.0.201/255.255.255.0/eth0
[root@RAC1 bin]#./srvctl modify nodeapps -n rac2 -A 138.30.0.202/255.255.255.0/eth0

[root@RAC1 bin]# su - oracle
[oracle@RAC1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.rac1.gsd   application    OFFLINE   OFFLINE              
ora.rac1.ons   application    OFFLINE   OFFLINE              
ora.rac1.vip   application    OFFLINE   OFFLINE              
ora.rac2.gsd   application    OFFLINE   OFFLINE              
ora.rac2.ons   application    OFFLINE   OFFLINE              
ora.rac2.vip   application    OFFLINE   OFFLINE              
[oracle@RAC1 ~]$ srvctl start nodeapps -n rac1
[oracle@RAC1 ~]$ srvctl start nodeapps -n rac2
[oracle@RAC1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       

[root@RAC1 db_1]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:59:C5:40 
          inet addr:138.30.0.101  Bcast:138.30.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe59:c540/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:367945 errors:0 dropped:0 overruns:0 frame.:0
          TX packets:1788789 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25845604 (24.6 MiB)  TX bytes:2599705197 (2.4 GiB)
          Interrupt:185 Base address:0x1480

eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:59:C5:40 
          inet addr:138.30.0.201  Bcast:138.30.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:185 Base address:0x1480

eth1      Link encap:Ethernet  HWaddr 00:0C:29:59:C5:4A 
          inet addr:100.100.1.1  Bcast:100.100.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe59:c54a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:32104 errors:0 dropped:0 overruns:0 frame.:0
          TX packets:34955 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11024742 (10.5 MiB)  TX bytes:17588443 (16.7 MiB)
          Interrupt:193 Base address:0x1800

可以看到vip地址已经修改成功。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值