用srvctl modify nodeapps命令更改vip地址

paulyibinyi發表於2009-05-31

     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地址已經修改成功。

 

 

 

 

 

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

相關文章