這篇文章給大家分享的是有關(guān)oracle 11gR2RAC如何修改public ip的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。
因?yàn)榕驼嬲\,有更多的客戶和我們聚集在一起,為了共同目標(biāo),成都創(chuàng)新互聯(lián)公司在工作上密切配合,從創(chuàng)業(yè)型企業(yè)到如今不斷成長,要感謝客戶對我們的高要求,讓我們敢于面對挑戰(zhàn),才有今天的進(jìn)步與發(fā)展。從網(wǎng)站到小程序定制開發(fā),軟件開發(fā),APP應(yīng)用開發(fā),10余年企業(yè)網(wǎng)站建設(shè)服務(wù)經(jīng)驗(yàn),為企業(yè)提供網(wǎng)站設(shè)計(jì),成都網(wǎng)站托管一條龍服務(wù).為企業(yè)提供營銷型網(wǎng)站建設(shè),按需網(wǎng)站制作,原創(chuàng)設(shè)計(jì),10余年品質(zhì),值得您的信賴.
Ⅰ修改public 選擇一個(gè)節(jié)點(diǎn)(這里選擇rac1)
查看hosts設(shè)置
[root@rac2 bin]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.215.188 rac1
192.168.215.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.215.120 rac1-vip
192.168.215.121 rac2-vip
#scan
192.168.215.122 scanip
查看crs資源狀態(tài)
[root@rac2 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR.dg
ONLINE OFFLINE rac1
ONLINE OFFLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.orcl.ssss.svc
1 ONLINE ONLINE rac2
2 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2
OCR磁盤組是offline,查下ocr狀態(tài)
grid@rac1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3388
Available space (kbytes) : 258732
ID : 1954953290
Device/File Name : +OCRA
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
發(fā)現(xiàn)無效的磁盤組OCR,那么刪掉 (這一步是我之前做實(shí)驗(yàn)替換了ocr的,直接略)
[grid@rac1 ~]$ srvctl remove diskgroup -g OCR
[grid@rac1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.orcl.ssss.svc
1 ONLINE ONLINE rac2
2 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2
查看當(dāng)前public配置
[root@rac1 bin]# ./oifcfg getif
eth2 10.0.0.0 global cluster_interconnect
eth0 192.168.215.0 global public
顯示為215網(wǎng)段,那么要改為56網(wǎng)段
[root@rac1 bin]# ./oifcfg delif -global eth0/192.168.215.0 #刪掉215網(wǎng)段
[root@rac1 bin]# ./oifcfg setif -global eth0/192.168.56.0:public #設(shè)置56網(wǎng)段
[root@rac1 bin]# ./oifcfg getif #查看修改情況兩個(gè)節(jié)點(diǎn)都看一下
eth2 10.0.0.0 global cluster_interconnect
eth0 192.168.56.0 global public
[root@rac2 bin]# ./oifcfg getif
eth2 10.0.0.0 global cluster_interconnect
eth0 192.168.56.0 global public
修改兩節(jié)點(diǎn)hosts文件 只改pubic ip 的網(wǎng)段
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.56.188 rac1
192.168.56.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.215.120 rac1-vip
192.168.215.121 rac2-vip
#scan
192.168.215.122 scanip
修改實(shí)際public地址為56網(wǎng)段的,兩個(gè)節(jié)點(diǎn)都要改。
[root@rac1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:9c:25:21
TYPE=Ethernet
UUID=c2ec39dd-92bf-41fc-8d41-21d78536c9f9
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.56.189
NETMASK=255.255.255.0
GATEWAY=192.168.56.1
IPV6INIT=no
USERCTL=no
修改完后service network restart
Ⅱ修改vip 依然選擇rac1(官方文檔中是停一個(gè)節(jié)點(diǎn)修改這個(gè)節(jié)點(diǎn),然后啟動(dòng)在修改下一個(gè)節(jié)點(diǎn))
停止節(jié)點(diǎn)1的實(shí)例和vip資源
[root@rac1 bin]# ./srvctl stop instance -d orcl -n rac1
[root@rac1 bin]# ./srvctl stop vip -n rac1 -f
PRCC-1017 : 192.168.215.190 was already stopped on rac1
PRCR-1005 : Resource ora.rac1.vip is already stopped
修改兩節(jié)點(diǎn)對應(yīng)的vip
[root@rac1 bin]# ./srvctl modify nodeapps -n rac1 -A 192.168.56.120/255.255.255.0/eth0
[root@rac1 bin]# ./srvctl modify nodeapps -n rac2 -A 192.168.56.121/255.255.255.0/eth0
查看結(jié)果
[root@rac1 bin]# ./srvctl config nodeapps -a
Network exists: 1/192.168.56.0/255.255.255.0/eth0, type static
VIP exists: /192.168.56.120/192.168.56.120/192.168.56.0/255.255.255.0/eth0, hosting node rac1
VIP exists: /192.168.56.121/192.168.56.121/192.168.56.0/255.255.255.0/eth0, hosting node rac2
重啟vip和instance
[root@rac1 bin]# ./srvctl start vip -n rac1
PRKO-2420 : VIP is already started on node(s): rac1
[root@rac1 bin]# ./srvctl start listener -n rac1
PRCC-1015 : LISTENER was already running on rac1
PRCR-1004 : Resource ora.LISTENER.lsnr is already running
[root@rac1 bin]# ./srvctl start instance -d orcl -n rac1
PRCC-1015 : orcl was already running on rac1
PRCR-1004 : Resource ora.orcl.db is already running
自己重啟了?看一下資源狀態(tài)
[root@rac1 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.orcl.ssss.svc
1 ONLINE ONLINE rac2
2 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
[root@rac1 bin]#
修改兩節(jié)點(diǎn)hosts文件
[root@rac1 bin]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.56.188 rac1
192.168.56.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.56.120 rac1-vip
192.168.56.121 rac2-vip
#scan
192.168.215.122 scanip
~
Ⅲ修改scanip (這次選擇rac2)
我的scanip 名字就叫scanip
[root@rac2 bin]# ./srvctl config scan
SCAN name: scanip, Network: 1/192.168.56.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scanip/192.168.215.122
#顯示還是215網(wǎng)段
停止scan和listener
[root@rac2 bin]# ./srvctl stop scan_listener
[root@rac2 bin]# ./srvctl stop scan
修改兩節(jié)點(diǎn)hosts文件
[root@rac2 bin]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.56.188 rac1
192.168.56.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.56.120 rac1-vip
192.168.56.121 rac2-vip
#scan
192.168.56.122 scanip #修改為56網(wǎng)段
修改scanip
[root@rac2 bin]# ./srvctl modify scan -n scanip #刷新scanip,實(shí)際上從hosts中讀取地址
[root@rac2 bin]# ./srvctl config scan #查看刷新情況
SCAN name: scanip, Network: 1/192.168.56.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scanip/192.168.56.122
修改成功,重啟scan和listener
[root@rac2 bin]# ./srvctl start scan
[root@rac2 bin]# ./srvctl start scan_listener
感謝各位的閱讀!關(guān)于“oracle 11gR2RAC如何修改public ip”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識,如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!