轉載一個step by step change public-ip and vip on RAC

lwitpub發表於2012-03-22
更改10g RAC公網IP以及VIP的簡單步驟:
1. Stop all crs resources 標準操作步驟,參考另一帖子:
http://space.itpub.net/628922/viewspace-690171
2. Modify /etc/hosts 這裡修改以後為如下:
[oracle@hsdb1 admin]$ cat /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
 
#### for oracle rac
 
192.168.5.220    hsdb1
192.168.5.222    hsdb1-vip
10.10.10.1       hsdb1-priv
 
192.168.5.221    hsdb2
192.168.5.223    hsdb2-vip
10.10.10.2       hsdb2-priv
(注:RAC中所有節點都需要進行修改。)

3. Change $ORACLE_HOME/network/admin/listener.ora 這裡修改以後如下:
[oracle@hsdb1 admin]$ cat listener.ora ……………………………………………………………………………………………………
LISTENER_HSDB1 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.222)(PORT = 1521)(IP = FIRST)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.220)(PORT = 1521)(IP = FIRST)) ) )
(注:如果這裡host你用的name,那麼不必進行修改。)

4. Delete Public eth0 (在其中一個node操作即可) [root@localhost bin]# ./oifcfg getif
eth0 192.168.1.0 global public eth1 10.10.10.0 global cluster_interconnect   [root@localhost bin]# ./oifcfg delif -global eth0 [root@localhost bin]# ./oifcfg getif
eth1 10.10.10.0 global cluster_interconnect

5. Add new public eth0 [root@localhost bin]# ./oifcfg setif -global eth0/192.168.5.0:public   [root@localhost bin]# ./oifcfg getif
eth0 192.168.5.0 global public <== 新的網段 eth1 10.10.10.0 global cluster_interconnect   (注:因為vip地址必須跟public ip處於同一網段,故公網IP網段更改以後,必須更改vip地址或網段。)
6. Change vip
++++++ Node 1 ++++++
[root@hsdb1 bin]# ./srvctl modify nodeapps -n hsdb1 -A 192.168.5.222/255.255.255.0/eth0
 
++++++ Node 2 ++++++
[root@hsdb2 bin]# ./srvctl modify nodeapps -n hsdb2 -A 192.168.5.223/255.255.255.0/eth0

7. Start cluster all resource
參考另一個帖子:
http://space.itpub.net/628922/viewspace-690171 crs_stat -t 如果有OFFLINE的resource,手工crs_start啟動即可

8. Change local_listener
++++++ Node 1 ++++++

SQL>show parameter listener

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=tcp)(HOST=1
92.168.1.222)(PORT=1521))

SQL>ALTER system SET local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.222)(PORT = 1521))' scope = BOTH sid = 'hskj1';

System altered.

++++++ Node 2 ++++++

SQL> ALTER system SET local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.223)(PORT = 1521))' scope = BOTH sid = 'hskj2';

System altered.

另外,ssh等效性不需要重新配置。

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

相關文章