Oracle RAC修改IP和VIP地址
背景:RAC測試環境停掉一段時間後重啟發現IP和其它環境IP衝突,所以決定修改RAC測試環境的IP地址
作業系統版本: redhat 5.2
oracle版本: ORACLE 10.2.0.4 +ASM
IP 地址做如下修改:
Public IP 172.16.27.251/252 -- > 172.16.27.3/4
Privite IP 192.168.0.11/12 -- > 192.168.0.11/12
Virtual IP 172.16.27.253/254 -- > 172.16.27.3/4
1.停止oracle相關的所有程式, 包括資料庫, asm, node application, crs本身.
檢視當前系統上crs執行的狀態
[oracle@node1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....E1.lsnr application OFFLINE OFFLINE
ora.node1.gsd application OFFLINE OFFLINE
ora.node1.ons application OFFLINE OFFLINE
ora.node1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....E2.lsnr application OFFLINE OFFLINE
ora.node2.gsd application OFFLINE OFFLINE
ora.node2.ons application OFFLINE OFFLINE
ora.node2.vip application OFFLINE OFFLINE
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
2 停用crs
[root@node2 ~]# /etc/init.d/init.crs stop
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
3 修改 /etc/hosts 檔案。 保持2個節點的一致
[oracle@node1 ~]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
172.16.27.3 node1
172.16.27.4 node2
172.16.27.5 node1-vip
172.16.27.6 node2-vip
192.168.0.11 node1-priv
192.168.0.12 node2-priv
[oracle@node1 ~]$
4 修改IP地址
--節點1
[root@node1 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
NBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:7b:b3:4c
NETMASK=255.255.0.0
IPADDR=172.16.27.3
GATEWAY=172.16.30.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@node1 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth1
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth1
NBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:7b:b3:56
TYPE=Ethernet
NETMASK=255.255.0.0
IPADDR=192.168.0.11
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@node1 ~]#
節點2
[root@node2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
NBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:1f:22:6e
TYPE=Ethernet
NETMASK=255.255.0.0
IPADDR=172.16.27.4
GATEWAY=172.16.30.1
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@node2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth1
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth1
NBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:1f:22:78
TYPE=Ethernet
NETMASK=255.255.0.0
IPADDR=192.168.0.12
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@node2 ~]#
5 在兩個節點上分別重啟網路服務,使修改的IP生效。
[root@node1 bin]# service network restart
[root@node2 bin]# service network restart
6. 啟動crs, 設定oracle中ip地址相關的設定.
在兩個節點啟動crs, 並關閉隨crs啟動的應用程式
[root@node1 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 90 seconds.
[root@node2 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 90 seconds.
7.由於oracle所有應用設定為自動啟動, 所以在crs啟動時會試圖啟動所有的服務, 但是在對oracle相關的ip地址進行設定時需要crs處於執行狀態. 但是資料庫, asm和node application處於停止狀態,
使用crs_stop -f把資料庫相關的服務停掉
如:
[oracle@node2 ~]$ crs_stop -f ora.node1.ons
Attempting to stop `ora.node1.ons` on member `node1`
Stop of `ora.node1.ons` on member `node1` succeeded.
最後檢視狀態
[oracle@node1 ~]$ crs_stat2
HA Resource Target State
---------- ---- ----
ora.node1.ASM1.asm OFFLINE OFFLINE
ora.node1.LISTENER_NODE1.lsnr OFFLINE OFFLINE
ora.node1.gsd OFFLINE OFFLINE
ora.node1.ons OFFLINE OFFLINE
ora.node1.vip OFFLINE OFFLINE
ora.node2.ASM2.asm OFFLINE OFFLINE
ora.node2.LISTENER_NODE2.lsnr OFFLINE OFFLINE
ora.node2.gsd OFFLINE OFFLINE
ora.node2.ons OFFLINE OFFLINE
ora.node2.vip OFFLINE OFFLINE
ora.racdb.db OFFLINE OFFLINE
ora.racdb.racdb1.inst OFFLINE OFFLINE
ora.racdb.racdb2.inst OFFLINE OFFLINE
8.使用oifcfg修改網路卡設定, oifconfig可以用來設定和檢視網路卡使用的方式.
注: 如果修改的網段相同,可以不做這一步。
-- 檢視當前配置:
[root@node1 bin]# oifcfg getif -global
eth0 172.16.0.0 global public
eth1 192.168.0.0 global cluster_interconnect
--刪除當前配置
[root@node1 bin]# ./oifcfg delif -global eth0
[root@node1 bin]# ./oifcfg delif -global eth1
--新增當前配置
[root@node1 bin]# ./oifcfg setif -global eth0/172.16.0.0:public
[root@node1 bin]# ./oifcfg setif -global eth1/192.168.0.0:cluster_interconnect
[root@node1 bin]# oifcfg getif -global
eth0 172.16.0.0 global public
eth1 192.168.0.0 global cluster_interconnect
9. 修改VIP
[root@node1 bin]# srvctl modify nodeapps -n node1 -A 172.16.27.5/255.255.255.0/eth0
[root@node1 bin]# srvctl modify nodeapps -n node2 -A 172.16.27.6/255.255.255.0/eth0
10.設定listener.ora和tnsnames.ora, 檢查這些檔案中是否有指定原來ip的地方, 修改為更改後的ip地址
[oracle@node2 admin]$ vi listener.ora
# listener.ora.node2 Network Configuration File: /opt/ora10g/product/10.2.0/db_1/network/admin/listener.ora.node2
# Generated by Oracle configuration tools.
LISTENER_NODE2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.27.4)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
11.啟動資料庫
[oracle@node2 admin]$ crs_start -all
[oracle@node1 ~]$ crs_stat2
HA Resource Target State
---------- ---- ----
ora.node1.ASM1.asm ONLINE ONLINE on node1
ora.node1.LISTENER_NODE1.lsnr ONLINE ONLINE on node1
ora.node1.gsd ONLINE ONLINE on node1
ora.node1.ons ONLINE ONLINE on node1
ora.node1.vip ONLINE ONLINE on node1
ora.node2.ASM2.asm ONLINE ONLINE on node2
ora.node2.LISTENER_NODE2.lsnr ONLINE ONLINE on node2
ora.node2.gsd ONLINE ONLINE on node2
ora.node2.ons ONLINE ONLINE on node2
ora.node2.vip ONLINE ONLINE on node2
ora.racdb.db ONLINE ONLINE on node1
ora.racdb.racdb1.inst ONLINE ONLINE on node1
ora.racdb.racdb2.inst ONLINE ONLINE on node2
[oracle@node1 ~]$
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21605631/viewspace-715559/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RAC 修改 IP 地址Oracle
- Oracle RAC修改public, VIP, SCAN IPOracle
- Oracle RAC修改public,private,vip scan IPOracle
- RAC中修改IP, VIP
- RAC 11.2.0.3 修改VIP地址
- RAC修改IP地址
- oracle 11g rac 修改VIP、scan VIP、priv IP操作文件Oracle
- 10g RAC中修改VIP地址
- Oracle RAC中的Public IP, VIP和Internal IP,SCANOracle
- 【RAC】Oracle rac修改IP地址及埠號命令參考Oracle
- Oracle 11gR2 RAC修改SCAN IP地址Oracle
- RAC改VIP和SCAN IP
- 【RAC】Oracle rac 如何修改公網及vipOracle
- ORACLE10g修改RAC VIPOracle
- 【VIP】調整RAC虛擬IP地址(VIP)及虛擬主機名
- RAC如何修改VIP
- 更改rac的vip地址和叢集互聯地址
- 11g RAC 修改PUBLIC-IP、VIP、PRIV-IP、SCAN-IP
- rac 新增第二public ip 和 vip
- (轉)【VIP】調整RAC虛擬IP地址(VIP)及虛擬主機名
- oracle10g RAC更改主機public地址及vip地址Oracle
- 基於RedHat的RAC環境下修改ip及vipRedhat
- Ubuntu配置和修改IP地址Ubuntu
- Solaris下修改RAC環境節點IP地址
- Oracle RAC修改Scan IP,Public IP的方法Oracle
- 修改RAC 地址
- 【RAC】如何修改SCAN IP的IP地址、名稱、埠等資訊
- ORACLE RAC 環境下修改IPOracle
- Oracle9i RAC 修改IPOracle
- 修改oracle 10g rac(rhel4)的vipOracle 10g
- RAC修改叢集兩個節點public ip地址
- 【RAC】如何修改vip 或者vip 對應的hostname
- 10g下修改VIP地址
- rac 手動漂移scan ip vip
- Oracle 11g修改RAC SCAN IPOracle
- oracle 10g rac modify public ip,private ip,vip實驗步驟Oracle 10g
- Oracle 12. 2 RAC public IP與vip 互換方法Oracle
- Oracle RAC環境下vip/public/private IP的區別Oracle