Solaris下修改RAC環境節點IP地址

yangtingkun發表於2010-07-10

簡單描述一下如何修改RAC環境中節點的IP地址。

 

 

這是一個3節點RAC環境:

SQL> SELECT INSTANCE_NUMBER, INSTANCE_NAME, HOST_NAME, VERSION, STATUS
  2  FROM GV$INSTANCE;

INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME  VERSION           STATUS
--------------- ---------------- ---------- ----------------- ------------
              1 testrac1         racnode1   10.2.0.4.0        OPEN
              3 testrac3         racnode3   10.2.0.4.0        OPEN
              2 testrac2         racnode2   10.2.0.4.0        OPEN

檢查三個節點的地址配置:

bash-2.03$ more /etc/hosts
#
# Internet host table
#
127.0.0.1       localhost      
172.25.198.222  racnode1        loghost
172.25.198.224  racnode1-vip
10.0.0.1        racnode1-priv
172.25.198.223  racnode2
172.25.198.225  racnode2-vip
10.0.0.2        racnode2-priv
172.25.198.226 racnode3
172.25.198.227 racnode3-vip
10.0.0.3 racnode3-priv

下面準備修改節點3對應的PUBLIC IPPRIVATE IPVITUAL IP

首先關閉例項3上的資料庫和CLUSTERWARE

# /etc/init.d/init.crs stop
Shutting down Oracle Cluster Ready Services (CRS):
Jun 13 11:07:50.361 | INF | daemon shutting down
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.

修改三個主機上的/etc/hosts檔案,將裡面的節點3的配置改為目標IP地址:

172.25.198.228 racnode3 loghost
172.25.198.229 racnode3-vip
10.0.0.4 racnode3-priv

確保3個節點上的/etc/host檔案都被修改:

# more /etc/hosts
#
# Internet host table
#
::1     localhost      
127.0.0.1       localhost
172.25.198.228 racnode3 loghost
172.25.198.229 racnode3-vip
10.0.0.4 racnode3-priv
172.25.198.222 racnode1
172.25.198.224 racnode1-vip
10.0.0.1 racnode1-priv
172.25.198.223 racnode2
172.25.198.225 racnode2-vip
10.0.0.2 racnode2-priv

在節點三上手工修改IP

# ifconfig ce1 10.0.0.4 netmask 255.255.0.0 broadcast 10.0.255.255
# ifconfig ce0 172.25.198.228 netmask 255.255.0.0 broadcast 172.25.255.255

修改PUBLIC IP後,需要以新的IP地址重新連線節點3

# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
        inet 172.25.198.228 netmask ffff0000 broadcast 172.25.255.255
        ether 0:3:ba:2c:d8:da
ce1: flags=1000843 mtu 1500 index 3
        inet 10.0.0.4 netmask ffff0000 broadcast 10.0.255.255
        ether 0:3:ba:2c:d8:da

確認PUBLIC IPPRIVATE IP已經正常。

檢查各個節點上的tnsnames.ora以及資料庫中的remote_listener引數,如果這些配置是透過主機名進行的配置則無需修改。如果是透過IP直接配置的,那麼根據節點3的新地址進行相應的修改。

修改結束後,在節點1或節點2上以圖形方式用root啟動VIPCA,進行節點3VIP的配置:

# xhost +
access control disabled, clients can connect from any host
# /data/oracle/product/10.2/crs/bin/vipca

如果前面對/etc/hosts下的修改正確的話,這裡不需要進行任何的修改,Oracle自動可以找到對應的新地址。點選確認後,Oracle在重新配置VIP過程中會報錯,因為節點3上的CLUSTERWARE並未啟動,忽略這個錯誤。

在節點3上啟動CLUSTERWARE和資料庫:

# /etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.

切換到Oracle,檢查

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on 星期日 6 13 11:36:40 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> SET PAGES 100 LINES 120
SQL> COL HOST_NAME FORMAT A10
SQL> SELECT INSTANCE_NUMBER, INSTANCE_NAME, HOST_NAME, VERSION, STATUS
  2  FROM GV$INSTANCE;

INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME  VERSION           STATUS
--------------- ---------------- ---------- ----------------- ------------
              3 testrac3         racnode3   10.2.0.4.0        OPEN
              2 testrac2         racnode2   10.2.0.4.0        OPEN
              1 testrac1         racnode1   10.2.0.4.0        OPEN

SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;

INSTANCE_NAME
----------------
testrac3

節點地址修改完成。

 

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

相關文章