一、情況說明 1. 資料庫資訊
作業系統版本 : OEL6.5 x64
資料庫版本 : Oracle 11.2.0.4 x64 RAC
本文針對oracle 11.2.0.4 x64 for OEL6.5上的publiic/private/VIP/scan ip地址更改過程。詳細修改過程如下,如在生產環境中修改需要反覆測試後操作。
2. IP地址對應資訊
原IP地址
192.168.10.201 node1
192.168.10.202 node2
192.168.10.203 node1-vip
192.168.10.204 node2-vip
10.10.10.10 node1-priv
10.10.10.20 node2-priv
192.168.10.200 scan-cluster
調整後IP地址
192.168.76.211 node1
192.168.76.212 node2
192.168.76.213 node1-vip
192.168.76.214 node2-vip
20.20.20.20 node1-priv
20.20.20.21 node2-priv
192.168.76.210 scan-cluster
二、停止crs及其它服務資源1. 禁止兩節點自動啟動監聽
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl disable listener
2. 停止兩節點監聽
# ./srvctl stop listener
3. 禁止兩節點自動啟動資料庫,停止資料庫
# ./srvctl disable database -d orcl
4. 停止兩節點資料庫
# ./srvctl stop database -d orcl -o immediate
5. 禁止兩節點自動啟動VIP
# ./srvctl disable vip -i "node1-vip"
# ./srvctl disable vip -i "node2-vip"
6. 停止兩節點VIP
# ./srvctl stop vip -n node1
# ./srvctl stop vip -n node2
7. 禁止節點的SCAN_LISTENER的啟動並停止SCAN監聽
# ./srvctl disable scan_listener
# ./srvctl stop scan_listener
8. 禁止所有節點的SCAN的啟動
# ./srvctl disable scan
9. 停止所有節點的SCAN
# ./srvctl stop scan
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243546432-0.png" height="721" />
10. 停止CRS (1)node1節點上操作
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243544592-1.png" height="677" />
(2)node2節點上操作
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243541115-2.png" height="572" />
三、修改Public網卡IP地址並啟動crs 1. 修改兩節點/etc/hosts檔案
192.168.76.211 node1
192.168.76.212 node2
192.168.76.213 node1-vip
192.168.76.214 node2-vip
20.20.20.20 node1-priv
20.20.20.21 node2-priv
192.168.76.210 scan-cluster
2. 修改伺服器業務網卡地址
node1節點
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=192.168.76.211
NETMASK=255.255.255.0
GATEWAY=192.168.76.2
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
node2節點
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=192.168.76.212
NETMASK=255.255.255.0
GATEWAY=192.168.76.2
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
3. node1節點啟動crs
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/224354H47-3.png" height="82" />
4. node2節點啟動crs
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/224354M96-4.png" height="81" />
過一會兒,通過crs_stat -t進行查看.
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/224354K32-5.png" height="461" />
四、修改Public IP地址 1. 叢集的public IP 設定
# 擷取叢集IP地址配置,如果修改的IP地址只是同一個網段,下面不需要修改.
# ./oifcfg getif
bond0 192.168.10.0 global public
bond1 10.10.10.0 global cluster_interconnect
# ./oifcfg delif -global bond0
# ./oifcfg setif -global bond0/192.168.76.0:public
# ./oifcfg getif
bond1 10.10.10.0 global cluster_interconnect
bond0 192.168.76.0 global public
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243544U9-6.png" height="179" />
2. 修改Network網路資源
# 注: 11.2.0.2以上版本RAC,需要修改network網路資源
# 查看當前network配置
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl config network
網路存在: 1/192.168.10.0/255.255.255.0/bond0, 類型 static
可以看到網路資源還是原來的IP地址資訊,需要修改.
# ./srvctl modify network -k 1 -S 192.168.76.0/255.255.255.0/eth0 -v
# 說明:-k指定的是network number,exists後面的數字。-S 指定新的子網地址/新的子網路遮罩/新介面。
# ./srvctl config network
網路存在: 1/192.168.76.0/255.255.255.0/bond0, 類型 static
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243545031-7.png" height="123" />
五、修改Private IP地址
說明: 通過Private IP地址是私人IP地址,通過VLAN進行隔離,是不需要進行修改的,除非有特別的要求必須要修改。
如果不需要修改,這一節的內容可以跳過。
1. 添加新的Private IP地址
# ./oifcfg getif
bond1 10.10.10.0 global cluster_interconnect
bond0 192.168.76.0 global public
直接刪除掉,刪除不了,必須要先添加新的,然後再刪除舊的內容。
# ./oifcfg delif -global bond1
PRIF-31: Failed to delete the specified network interface because it is the last private interface
# ./oifcfg setif -global bond1/20.20.20.0:cluster_interconnect
# ./oifcfg getif
bond1 10.10.10.0 global cluster_interconnect
bond0 192.168.76.0 global public
bond1 20.20.20.0 global cluster_interconnect
2. 刪除掉原來舊的IP地址資訊
# ./oifcfg delif -global bond1/10.10.10.0:cluster_interconnect
# ./oifcfg getif
bond0 192.168.76.0 global public
bond1 20.20.20.0 global cluster_interconnect
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243543144-8.png" height="228" />
3. 修改Private IP地址
說明:PrivateIP必須要先修改然後再修改網卡的IP地址。
node1節點
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
BOOTPROTO=none
IPADDR=20.20.20.20
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
node2節點
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
BOOTPROTO=none
IPADDR=20.20.20.21
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
# service network restart
六、修改叢集VIP地址
1. 先查看叢集的VIP
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl config vip -n node1
VIP 存在: /node1-vip/192.168.76.213/192.168.10.0/255.255.255.0/bond0, 託管節點 node1
2. 叢集的VIP配置
# ./srvctl modify nodeapps -n node1 -A 192.168.76.213/255.255.255.0/bond0
# ./srvctl modify nodeapps -n node2 -A 192.168.76.214/255.255.255.0/bond0
3. VIP地址查看
# ./srvctl config vip -n node1
VIP 存在: /node1-vip/192.168.76.213/192.168.76.0/255.255.255.0/bond0, 託管節點 node1
# ./srvctl config vip -n node2
VIP 存在: /node2-vip/192.168.76.214/192.168.76.0/255.255.255.0/bond0, 託管節點 node2
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243541463-9.png" height="123" />
七、叢集的SCANIP設定 1. 查看叢集的SCAN IP
# ./srvctl config scan
SCAN 名稱: scan-cluster, 網路: 1/192.168.76.0/255.255.255.0/bond0
SCAN VIP 名稱: scan1, IP: /scan-cluster/192.168.10.200
2. 修改SCAN IP地址
# ./srvctl modify scan -n 192.168.76.210
3. 查看修改後結果
# ./srvctl config scan
SCAN 名稱: 192.168.76.210, 網路: 1/192.168.76.0/255.255.255.0/bond0
SCAN VIP 名稱: scan1, IP: /192.168.76.210/192.168.76.210
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/22435415R-10.png" height="129" />
八、啟動RAC叢集
節點1上操作
# cd /u01/app/11.2.0/grid_1/bin
# ./srvctl enable listener
# ./srvctl enable vip -i "node1-vip"
# ./srvctl enable vip -i "node2-vip"
# ./srvctl enable scan_listener
# ./srvctl enable scan
# ./srvctl enable database -d orcl
# ./srvctl start listener
# ./srvctl start scan_listener
# ./srvctl start scan
# ./srvctl start database -d orcl
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/22435433J-11.png" height="259" />
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.bkjia.com/uploads/allimg/140207/2243546163-12.png" height="464" />
本文出自 “koumm的linux技術部落格” 部落格,請務必保留此出處http://koumm.blog.51cto.com/703525/1353237