- 資訊首頁(yè) > 數據庫 >
- Oracle RAC修改網(wǎng)絡(luò )配置知識點(diǎn)匯總
Oracle RAC修改網(wǎng)絡(luò )配置知識點(diǎn)匯總 發(fā)布時(shí)間:2021-08-23 14:56 來(lái)源:ITPUB博客 閱讀:0 作者: 欄目: 數據庫 歡迎投稿:712375056
本文參考:
How to Modify Public Network Information including VIP in Oracle Clusterware (文檔 ID 276434.1) How to Modify Private Network Information in Oracle Clusterware (文檔 ID 283684.1) How to Modify SCAN Setting or SCAN Listener Port after Installation (文檔 ID 972500.1) How to Update the IP Address of the SCAN VIP Resources (ora.scan{n}.vip) (文檔 ID 952903.1)
場(chǎng)景一:修改public公共網(wǎng)卡對應主機名 場(chǎng)景二:僅更改public公共IP或VIP(而不更改接口、子網(wǎng)或網(wǎng)絡(luò )掩碼,或僅更改MAC地址而不更改任何其他內容) 場(chǎng)景三:更改public公共網(wǎng)絡(luò )網(wǎng)卡、子網(wǎng)或網(wǎng)絡(luò )掩碼 場(chǎng)景四:更改VIP IP或hostname 場(chǎng)景五:更改SCAN VIP配置及端口 場(chǎng)景六:修改私有網(wǎng)卡主機名 場(chǎng)景七:僅更改私有IP(而不更改網(wǎng)絡(luò )接口、子網(wǎng)和網(wǎng)絡(luò )掩碼或者只更改專(zhuān)用IP MAC地址而不更改其他任何內容) 場(chǎng)景八:僅更改私有網(wǎng)絡(luò )MTU 場(chǎng)景九:更改私有網(wǎng)絡(luò )接口名稱(chēng)、子網(wǎng)或網(wǎng)絡(luò )掩碼 場(chǎng)景十:使用HAIP為11gR2及以上版本添加或刪除cluster_interconnect
場(chǎng)景一:修改公共網(wǎng)卡對應主機名
公共主機名記錄在OCR中,在安裝階段輸入,安裝后很難對其進(jìn)行修改。
修改公共主機名方法如下:
方法1:刪除節點(diǎn),然后使用新主機名重新添加節點(diǎn),或者重新安裝clusterware,或者按照克隆過(guò)程重新配置clusterware。
方法2:重新運行CRS的配置文件rootconfig,重新格式化OCR和Voting disk,然后重新創(chuàng )建CRS的資源。
方法2來(lái)自:https://blog.csdn.net/xujinyang/article/details/6833717
(1)關(guān)閉crs
crsctl stop crs
(2)修改主機名
hostnamectl set-hostname <newname>
(3)修改/etc/hosts和/etc/sysconfig/network等配置
(4)修改$ORA_CRS_HOME/install/rootconfig配置文件
當我們安裝完Clusterware的時(shí)候,需要執行root.sh 腳本,該腳本就會(huì )調用$ORA_CRS_HOME/install/rootconfig。
當我們修改了hostname時(shí),也必須修改這個(gè)腳本。
(5)清空OCR 和 Voting Disks
dd if=/dev/zero of=/dev/raw/raw1 bs=1M count=200 ---危險操作,謹慎執行
(6)刪除配置信息
rootconfig 腳本會(huì )檢查Clusterware 是否已經(jīng)配置,如果已經(jīng)配置,就不會(huì )執行,所以在執行rootconfig之前,我們要寫(xiě)刪除這個(gè)配置信息。
在Linux 下,刪除文件:/etc/oracle/ocr.loc,/etc/oracle/ocr.loc,
Unix下位置不一樣,HP-Unix 是:/var/opt/oracle/ocr.log
(7)運行 $ORA_CRS_HOME/install/rootconfig
用root 用戶(hù)分別在2個(gè)節點(diǎn)執行,一個(gè)節點(diǎn)一個(gè)節點(diǎn)順序執行,不要同時(shí)執行,在最后一個(gè)節點(diǎn)執行時(shí),會(huì )配置VIPs。
(8)驗證Clusterware
[root@rac1 bin]# ./crs_stat -t
(9)添加Listener Resource到CRS
調用netca命令,會(huì )把監聽(tīng)的信息注冊到OCR中。
(10)檢查修改listener.ora 和 tnsnames.ora 文件
(11)添加其他資源到OCR
ASM
語(yǔ)法:srvctl add asm -n <node_name> -i <asm_instance_name> -o <oracle_home>
[oracle@racdb1 bin]$ srvctl add asm -n racdb1 -i ASM1 -o /u01/app/oracle/product/10.2.0/db_1
[oracle@racdb1 bin]$ srvctl add asm -n racdb2 -i ASM2 -o /u01/app/oracle/product/10.2.0/db_1
DATABASE
語(yǔ)法:srvctl add database -d <db_unique_name> -o <oracle_home>
[oracle@racdb1 bin]$ srvctl add database -d orcl -o /u01/app/oracle/product/10.2.0/db_1
INSTANCE
語(yǔ)法:srvctl add instance -d <db_unique_name> -i <instance_name> -n <node_name>
[oracle@racdb1 bin]$ srvctl add instance -d orcl -i orcl1 -n racdb1
[oracle@racdb1 bin]$ srvctl add instance -d orcl -i orcl2 -n racdb2
SERVICE
語(yǔ)法:srvctl add service -d <db_unique_name> -s <service_name> -r <preferred_list> -P <TAF_policy>
-r preferred_list 是首先使用的實(shí)例的列表,還可是用-a 表示備用實(shí)例
TAF_policy可設置為NONE,BASIC,PRECONNECT
[oracle@racdb1 bin]$ srvctl add service -d orcl -s oltp -r orcl1,orcl2 -P BASIC
場(chǎng)景二:僅更改公共IP或VIP(而不更改網(wǎng)卡名、子網(wǎng)或網(wǎng)絡(luò )掩碼,或僅更改MAC地址而不更改任何其他內容)
如果更改僅為公共IP或VIP地址,且新地址仍在同一子網(wǎng)、同一接口中,或者如果更改僅為公共IP MAC地址、IP/接口/子網(wǎng)/網(wǎng)絡(luò )掩碼均保持不變,則無(wú)需在clusterware層執行任何操作,所有更改都需要在OS層執行以反映更改。
1.停止CRS
crsctl stop crs
2.修改網(wǎng)絡(luò )層的IP地址、DNS和/etc/hosts文件以反映更改或修改網(wǎng)絡(luò )層的MAC地址
3.啟動(dòng)CRS
crsctl start crs
注意:上述更改可以滾動(dòng)方式完成,例如:一次一個(gè)節點(diǎn)順序執行。
場(chǎng)景三:更改公共網(wǎng)絡(luò )網(wǎng)卡、子網(wǎng)或網(wǎng)絡(luò )掩碼
如果更改涉及不同的子網(wǎng)(網(wǎng)絡(luò )掩碼)或接口,請從OCR中刪除現有接口信息,并使用正確的信息重新添加。
在此示例中,通過(guò)兩個(gè)單獨的命令將子網(wǎng)從10.2.156.0更改為10.2.166.0,首先執行"delif",然后執行"setif":
% $CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>]
% $CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:public
For example:
1.刪除接口信息
% $CRS_HOME/bin/oifcfg delif -global eth0/10.X.156.0
2.添加接口ixnx
% $CRS_HOME/bin/oifcfg setif -global eth0/10.X.166.0:public
3.在操作系統層進(jìn)行更改。
注意:
(1)除非操作系統更改需要重新啟動(dòng)節點(diǎn),否則不需要重新啟動(dòng)Oracle clusterware。
(2)這可以通過(guò)滾動(dòng)方式完成。
(3)對于11gR2,上述命令要求clusterware在所有節點(diǎn)上運行,否則將報告PRIF-33和PRIF-32,即:
Note: for 11gR2, above command requires clusterware RUNNING on ALL nodes, otherwise PRIF-33 and PRIF-32 will be reported, i.e.
[grid@racnode1 bin]$ ./oifcfg delif -global <if_name>/192.168.1.0
PRIF-33: Failed to set or delete interface because hosts could not be discovered
CRS-02307: No GPnP services on requested remote hosts.
PRIF-32: Error in checking for profile availability for host <nodename>2
CRS-02306: GPnP service on host "<nodename>2" not found.
場(chǎng)景四:更改VIP IP或hostname
修改VIP地址或VIP HOSTNAME
注意:
1.一般來(lái)說(shuō),只有在10.2.0.3版本之前的版本中才需要完全停機。
2.從10.2.0.3開(kāi)始,ASM/數據庫實(shí)例對VIP資源的依賴(lài)關(guān)系將被刪除,因此可以在不必關(guān)閉ASM/數據庫實(shí)例的情況下修改VIP,當VIP關(guān)閉時(shí),只有到數據庫的客戶(hù)端連接將受到影響。
3.如果修改是特定于節點(diǎn)的,那么在更改期間,只有與該節點(diǎn)的連接才會(huì )受到影響。
收集當前VIP配置
1.收集現有設置
對于10g和11gR1,作為Oracle Clusterware所有者:
$ srvctl config nodeapps -n <nodename> -a
eg:
$ srvctl config nodeapps -n <nodename>1 -a
VIP exists.: /<nodename>1-vip/101.XX.XX.184/255.255.254.0/<if_name>
對于11gR2,作為Oracle Clusterware所有者:
$ srvctl config nodeapps -a
eg:
$ srvctl config nodeapps -a
Network exists: 1/101.17.80.0/255.255.254.0/<if_name>, type static
VIP exists: /racnode1-vip/101.17.XX.184/101.17.80.0/255.255.254.0/<if_name>, hosting node <nodename>1
VIP exists: /racnode2-vip/101.17.XX.186/101.17.80.0/255.255.254.0/<if_name>, hosting node <nodename>2
2.驗證VIP狀態(tài)
10.2 and 11.1:
$ crs_stat -t
11.2:
$ crsctl stat res -t
-它應該顯示VIPs在線(xiàn)
$ ifconfig -a
(netstat -in for HP and ipconfig /all for Windows)
-VIP邏輯接口綁定到公共網(wǎng)絡(luò )接口
停止資源
3.停止nodeapps資源(以及所有從屬資源ASM/DB,僅在需要時(shí)):
10g and 11gR1, as Oracle Clusterware owner:
$ srvctl stop instance -d <db_name> -i <inst_name> (optional for 10.2.0.3+)
$ srvctl stop asm -n <node_name> (optional for 10.2.0.3+)
$ srvctl stop nodeapps -n <node_name>
eg,
$ srvctl stop instance -d <DBNAME> -i <INSTANCENAME>
$ srvctl stop asm -n <nodename>1
$ srvctl stop nodeapps -n <nodename>1
11gR2, as Grid Infrastructure owner:
$ srvctl stop instance -d <db_name> -n <node_name> (optional)
$ srvctl stop vip -n <node_name> -f
eg,
$ srvctl stop instance -d <DBNAME> -n <nodename>1
$ srvctl stop vip -n <nodename>1 -f
注1:11gR2需要-f選項來(lái)停止偵聽(tīng)器資源,否則將發(fā)生以下錯誤:
Note 1: The -f option is required for 11gR2 to stop listener resource, otherwise following error will occur:
PRCR-1014 : Failed to stop resource ora.<nodename>1.vip
PRCR-1065 : Failed to stop resource ora.<nodename>1.vip
CRS-2529: Unable to act on 'ora.<nodename>1.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
...
4.驗證VIP現在處于脫機狀態(tài),并且該接口不再綁定到公共網(wǎng)絡(luò )接口
$ crs_stat -t (or $ crsctl stat res -t for 11gR2)
$ ifconfig -a
(netstat -in for HP and ipconfig /all for windows)
修改VIP及其關(guān)聯(lián)屬性
5.確定新的VIP IP/子網(wǎng)/網(wǎng)絡(luò )掩碼或VIP主機名,首先在操作系統上更改網(wǎng)絡(luò ),
確保新VIP已在DNS中注冊或在/etc/hosts(對于Unix/Linux)和\WINDOWS\System32\drivers\etc\hosts文件(對于WINDOWS)中修改。
如果網(wǎng)絡(luò )接口已更改,請確保新接口在服務(wù)器上可用,然后再繼續修改。
For example:
New VIP is: 110.XX.XX.11 <nodename>1-nvip
new subnet is 110.11.70.0
new netmask is 255.255.255.0
new interface is <if_name>
6.以root用戶(hù)身份修改VIP資源:
# srvctl modify nodeapps -n <node> -A <new_vip_address or new_vip_hostname>/<netmask>/<[if1[if2...]]>
eg:
# srvctl modify nodeapps -n <nodename>1 -A <nodename>1-nvip/255.255.255.0/<if_name>
注1:從11.2開(kāi)始,VIP取決于網(wǎng)絡(luò )資源(ora.net1.network),OCR僅記錄VIP主機名或與VIP資源關(guān)聯(lián)的IP地址。
網(wǎng)絡(luò )屬性(子網(wǎng)/網(wǎng)絡(luò )掩碼/接口)與網(wǎng)絡(luò )資源一起記錄。
修改nodeapps資源時(shí),網(wǎng)絡(luò )資源(ora.net1.network)屬性也會(huì )隱式修改。
從11.2.0.2開(kāi)始,如果只需要更改子網(wǎng)/網(wǎng)絡(luò )掩碼/接口,則可以通過(guò)srvctl modify網(wǎng)絡(luò )命令直接修改網(wǎng)絡(luò )資源。
From 11.2.0.2 onwards, if only subnet/netmask/interface change is required, network resource can be modified directly via srvctl modify network command.
as root user:
# srvctl modify network -k <network_number>] [-S <subnet>/<netmask>[/if1[|if2...]]
eg:
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0/<if_name>
如果其他屬性未更改,則無(wú)需修改VIP或SCAN。
注2:對于12.1.0.1版本,由于未發(fā)布的BUG 16608577-無(wú)法在ORACLE 12.1中添加第二個(gè)公共接口,srvctl modify網(wǎng)絡(luò )命令失敗,原因是:
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0/<if_name>
PRCT-1305 : The specified interface name "<if_name>2" does not match the existing network interface name "<if_name>1"
解決方法是使用空接口名稱(chēng)修改網(wǎng)絡(luò )資源,然后使用所需的接口名稱(chēng)再次修改它,例如:
Workaround is to modify network resource with an empty interface name, then modify it again with the desired interface name, eg:
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0/<if_name>2
該錯誤已在12.1.0.2及更高版本中修復。
The bug has been fixed in 12.1.0.2 and above.
*11gR2僅修改VIP主機名而不更改IP地址的特殊情況。
* A special case for 11gR2 modifying the VIP hostname only without changing the IP address.
例如:只有VIP主機名從<nodename>1-VIP更改為<nodename>1-nvip,IP和其他屬性保持不變。
For example: only VIP hostname changes from <nodename>1-vip to <nodename>1-nvip, IP and other attributes remain the same.
如果IP地址未更改,上述修改命令將不會(huì )更改“crsctl stat res ORA.<nodename>.VIP-p”輸出中的USR_ORA_VIP值。
請使用以下命令:
# crsctl modify res ora.<nodename>.vip -attr USR_ORA_VIP=<nodename>1-nvip
驗證USR_ORA_VIP字段的更改:
# crsctl stat res ora.<nodename>1.vip -p |grep USR_ORA_VIP
注意:對于Windows平臺,如果中間有空格,則接口名稱(chēng)需要在引號(")中,例如:
作為管理員用戶(hù)或軟件安裝用戶(hù):
> srvctl modify nodeapps -n <nodename> -A 110.XX.XX.11/255.255.255.0/"Local Area Connection 1"
7.驗證更改
$ srvctl config nodeapps -n <node> -a (10g and 11gR1)
$ srvctl config nodeapps -a (11gR2)
eg:
$ srvctl config nodeapps -n <nodename>1 -a
VIP exists.: /<nodename>1-nvip/110.11.70.11/255.255.255.0/<if_name>2
重啟資源
8.啟動(dòng)nodeapps和其他資源
10g and 11gR1, as Oracle Clusterware owner:
$ srvctl start nodeapps -n <node_name>
$ srvctl start asm -n <node_name> (optional for 10.2.0.3+)
$ srvctl start instance -d <dbanme> -i <inst> (optional for 10.2.0.3+)
eg:
$ srvctl start nodeapps -n <nodename>1
$ srvctl start asm -n <nodename>1
$ srvctl start instance -d <DBNAME> -i <INSTANCENAME>1
11gR2, as Grid Infrastructure owner:
$ srvctl start vip -n <node_name>
$ srvctl start listener -n <node_name>
$ srvctl start instance -d <db_name> -n <node_name> (optional)
eg,
$ srvctl start vip -n <nodename>1
$ srvctl start listener -n <nodename>1
$ srvctl start instance -d <DBNAME> -n <nodename>1
注意:如果更改了網(wǎng)絡(luò )屬性,即更改了網(wǎng)絡(luò )掩碼,請重新啟動(dòng)nodeapps
9.驗證新VIP是否在線(xiàn)并綁定到公共網(wǎng)絡(luò )接口
$ crs_stat -t (or $ crsctl stat res -t for 11gR2)
$ ifconfig -a
(netstat -in for HP or ipconfig /all for windows)
10.僅當需要進(jìn)行類(lèi)似更改時(shí),才對群集中的rest節點(diǎn)重復相同的步驟。
其他
11.如有必要,修改listener.ora, tnsnames.ora and LOCAL_LISTENER/REMOTE_LISTENER參數以反映VIP更改。
注意,ASM和DB的LOCAL_LISTENER由Grid Infrastructure自動(dòng)設置。
LOCAL_LISTENER中的VIP更改應自動(dòng)生效。
由于Bug 22824602,在某些條件下,ASM實(shí)例的LOCAL_LISTENER可能無(wú)法反映VIP更改。
解決方法是在受影響的節點(diǎn)上重新啟動(dòng)Clusterware。
場(chǎng)景五:更改SCAN VIP配置及端口
在Grid Infrastructure 11gR2中,為客戶(hù)端連接引入了SCAN和SACN VIP。要修改SCAN VIP,請參閱:
Note 952903.1 How to update the IP address of the SCAN VIP resources (ora.scan<n>.vip)
Note 972500.1 How to Modify SCAN Setting or SCAN Listener Port after Installation
在更改SCAN VIP之前,需要使用新的IP地址更新域名服務(wù)器(DNS)上的scan name條目。
這通常由網(wǎng)絡(luò )管理員完成。要檢查當前設置,可以使用以下命令:
nslookup <scan_name>
要檢查SCAN VIP的當前IP地址,請以root用戶(hù)身份運行以下命令:
$GRID_HOME/bin/srvctl config scan
停止SCAN listeners和SCAN
$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl stop scan
接下來(lái)使用DNS條目中的新IP地址刷新SCAN VIP:
$GRID_HOME/bin/srvctl modify scan -n <scan_name>
要檢查SCAN VIP是否已更改,請運行以下命令,它現在應顯示新的IP地址。
$GRID_HOME/bin/srvctl config scan
重新啟動(dòng)SCAN和SCAN listener
$GRID_HOME/bin/srvctl start scan
$GRID_HOME/bin/srvctl start scan_listener
如果SCAN VIPs的數量已更改,則需要更新SCAN listener:
$GRID_HOME/bin/srvctl modify scan_listener -u
下面是使用以下配置的示例:
1.SCAN的名稱(chēng)為sales-SCAN.example.com
2.公網(wǎng)子網(wǎng)為10.XXX.XXX.0
3.公網(wǎng)子網(wǎng)掩碼為255.XXX.XXX.0
4.public接口名稱(chēng)為eth1
5.舊IP addresses: 10.XXX.XXX.81, 10.XXX.XXX.82 & 10.XXX.XXX.83
6.新IP addresses: 10.XXX.XXX.121, 10.XXX.XXX.122 & 10.XXX.XXX.123
停止和啟動(dòng)SCAN VIPs/listeners可以由grid用戶(hù)完成,但是"srvctl modify SCAN"命令必須由root用戶(hù)執行,因此作為root用戶(hù)執行所有步驟是可行的。
DNS服務(wù)器上的SCAN查找顯示條目已使用新IP地址更新:
$ nslookup sales-scan.example.com
Server: dns1.example.com
Address: 10.XXX.XXX.70#53
Name: sales-scan.example.com
Address: 10.XXX.XXX.123
Name: sales-scan.example.com
Address: 10.XXX.XXX.122
Name: sales-scan.example.com
Address: 10.XXX.XXX.121
停止SCAN listener 和 the SCAN VIP 資源:
# $GRID_HOME/bin/srvctl stop scan_listener
# $GRID_HOME/bin/srvctl stop scan
# $GRID_HOME/bin/srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
SCAN VIP scan2 is enabled
SCAN VIP scan2 is not running
SCAN VIP scan3 is enabled
SCAN VIP scan3 is not running
# $GRID_HOME/bin/srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is not running
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is not running
SCAN VIP resources仍然顯示舊的地址
# $GRID_HOME/bin/srvctl config scan
SCAN name: sales-scan, Network: 1/10.XXX.XXX.0/255.XXX.XXX.0/eth1
SCAN VIP name: scan1, IP: /sales-scan.example.com/10.XXX.XXX.81
SCAN VIP name: scan2, IP: /sales-scan.example.com/10.XXX.XXX.82
SCAN VIP name: scan3, IP: /sales-scan.example.com/10.XXX.XXX.83
現在通知CRS更新SCAN VIP resources
# $GRID_HOME/bin/srvctl modify scan -n sales-scan.example.com
驗證更改已成功,再次檢查SCAN配置:
# $GRID_HOME/bin/srvctl config scan
SCAN name: sales-scan, Network: 1/10.XXX.XXX.0/255.XXX.XXX.0/eth1
SCAN VIP name: scan1, IP: /sales-scan.example.com/10.XXX.XXX.121
SCAN VIP name: scan2, IP: /sales-scan.example.com/10.XXX.XXX.122
SCAN VIP name: scan3, IP: /sales-scan.example.com/10.XXX.XXX.123
啟動(dòng)SCAN和SCAN監聽(tīng):
# $GRID_HOME/bin/srvctl start scan
# $GRID_HOME/bin/srvctl start scan_listener
注意:如果需要回滾更改,請重復已運行的命令,用原始值替換新值以恢復原始配置。
B.修改SCAN監聽(tīng)端口
grid用戶(hù)執行:
1.修改SCAN監聽(tīng)端口
$GRID_HOME/bin/srvctl modify scan_listener -p <new-SCAN-port>
更新11gR2數據庫init.ora參數:
alter system set remote_listener='<SCAN-name>:<new-port-number>' scope=both;
2.重啟SCAN listener,使得新端口生效
$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl start scan_listener
3.確認更改
$GRID_HOME/bin/srvctl config scan_listener
場(chǎng)景六:修改心跳網(wǎng)卡主機名
在11.2之前的Oracle Clusterware中,心跳主機名記錄在OCR中,無(wú)法更新。通常,不需要更改心跳主機名。
更改私有主機名的唯一方法是刪除/添加節點(diǎn),或重新安裝Oracle Clusterware。
在11.2 Grid Infrastructure中,心跳主機名不再記錄在OCR中,并且不依賴(lài)于心跳主機名。
它可以在/etc/hosts中自由更改。
場(chǎng)景七:僅更改私有IP(而不更改網(wǎng)絡(luò )接口、子網(wǎng)和網(wǎng)絡(luò )掩碼或者只更改專(zhuān)用IP MAC地址而不更改其他任何內容)
例如,私有IP從192.XXX.X.10更改為192.XXX.X.21,網(wǎng)絡(luò )接口名稱(chēng)和子網(wǎng)保持不變,或者M(jìn)AC地址更改,專(zhuān)用IP地址/接口名稱(chēng)/子網(wǎng)/網(wǎng)絡(luò )都保持不變。
1.在需要更改的節點(diǎn)上關(guān)閉Oracle Clusterware堆棧。
crsctl stop crs
2.根據需要在操作系統層(例如:/etc/hosts、操作系統網(wǎng)絡(luò )配置等)對私有網(wǎng)絡(luò )進(jìn)行IP或MAC修改。
3.重新啟動(dòng)Oracle Clusterware堆棧即可完成任務(wù)。
crsctl start crs
場(chǎng)景八:僅更改私有網(wǎng)絡(luò )MTU
例如,私有網(wǎng)絡(luò )MTU從1500更改為9000(啟用巨型幀),網(wǎng)絡(luò )接口名稱(chēng)和子網(wǎng)保持不變。
1.關(guān)閉所有節點(diǎn)上的Oracle Clusterware堆棧
crsctl stop crs
2.在操作系統網(wǎng)絡(luò )層對MTU大小進(jìn)行所需的網(wǎng)絡(luò )更改,確保心跳網(wǎng)絡(luò )具有所需的MTU大小,在所有群集節點(diǎn)上使用所需的MTU大小進(jìn)行ping
3.在所有節點(diǎn)上重新啟動(dòng)Oracle Clusterware堆棧
crsctl start crs
場(chǎng)景九:更改私有網(wǎng)絡(luò )接口名稱(chēng)、子網(wǎng)或網(wǎng)絡(luò )掩碼
注意:更改網(wǎng)絡(luò )掩碼,但子網(wǎng)ID不變時(shí),例如:
網(wǎng)絡(luò )掩碼從255.255.0.0更改為255.255.255.0,心跳IP為192.168.0.x,子網(wǎng)ID與192.168.0.0相同,網(wǎng)絡(luò )接口名稱(chēng)不變。
(1)在需要更改的所有群集節點(diǎn)上關(guān)閉Oracle Clusterware堆棧
(2)在操作系統層(例如:操作系統網(wǎng)絡(luò )配置等)對心跳網(wǎng)絡(luò )進(jìn)行IP修改
(3)在所有節點(diǎn)上重新啟動(dòng)Oracle Clusterware堆棧將完成任務(wù)。
請注意,此更改不能以滾動(dòng)方式進(jìn)行。
更改網(wǎng)絡(luò )掩碼時(shí),關(guān)聯(lián)的子網(wǎng)ID通常會(huì )更改。
Oracle僅在OCR中存儲網(wǎng)絡(luò )接口名稱(chēng)和子網(wǎng)ID,而不是網(wǎng)絡(luò )掩碼。
Oifcfg命令可用于此類(lèi)更改,Oifcfg命令只需要在集群節點(diǎn)的1個(gè)節點(diǎn)上運行,而不需要在所有節點(diǎn)上運行。
A.對于11gR2之前的Oracle Clusterware
1.使用oifcfg添加新的專(zhuān)用網(wǎng)絡(luò )信息,刪除舊的專(zhuān)用網(wǎng)絡(luò )信息:
% $ORA_CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:cluster_interconnect
% $ORA_CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>]]
For example:
% $ORA_CRS_HOME/bin/oifcfg setif -global <interfacename>3/192.168.2.0:cluster_interconnect
% $ORA_CRS_HOME/bin/oifcfg delif -global <interfacename>1/192.168.1.0
驗證更改
% $ORA_CRS_HOME/bin/oifcfg getif
eth0 10.X.XXX.0 global public
eth3 192.XXX.2.0 global cluster_interconnect
2.關(guān)閉Oracle Clusterware堆棧
As root user: # crsctl stop crs
3.在操作系統級別進(jìn)行所需的網(wǎng)絡(luò )更改,應在所有節點(diǎn)上修改/etc/hosts文件以反映更改。
確保新網(wǎng)絡(luò )在所有群集節點(diǎn)上可用:
% ping <private hostname/IP>
% ifconfig -a on Unix/Linux
or
% ipconfig /all on windows
4.重啟Oracle Clusterware堆棧
As root user: # crsctl start crs
注意:如果在Linux上運行OCFS2,可能還需要更改OCFS2用于與其他節點(diǎn)通信的心跳IP地址。
有關(guān)更多信息,請參閱Note 604958.1
B.適用于不帶Flex ASM的11gR2 Oracle Clusterware和12c群集
從11.2 Grid Infrastructure,心跳網(wǎng)絡(luò )配置不僅存儲在OCR中,還存儲在gpnp profile文件中。
如果心跳網(wǎng)絡(luò )不可用或其定義不正確,CRSD過(guò)程將不會(huì )啟動(dòng),OCR的任何后續更改將不可能進(jìn)行。
因此,在修改心跳網(wǎng)絡(luò )的配置時(shí)需要小心。
以正確的順序執行更改非常重要。
還請注意,不支持手動(dòng)修改gpnp profile文件。
在繼續之前,請在所有群集節點(diǎn)上備份profile.xml,已grid用戶(hù)執行:
$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
$ cp -p profile.xml profile.xml.bk
1.確保Oracle Clusterware正在群集中的所有群集節點(diǎn)上運行
2.已grid用戶(hù)執行:
獲取現有信息。例如:
$ oifcfg getif
<interfacename>1 100.17.10.0 global public
<interfacename>0 192.168.0.0 global cluster_interconnect
添加新的cluster_interconnect信息:
$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect
For example:
A.添加具有相同子網(wǎng)的新接口bond0
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
B.添加具有相同接口名稱(chēng)但不同子網(wǎng)或新接口名稱(chēng)的新子網(wǎng)
$ oifcfg setif -global eth0/192.65.0.0:cluster_interconnect
or
$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect
1.即使接口還不可用,也可以使用-global選項完成此操作,但如果接口不可用,則無(wú)法使用-node選項完成此操作,這將導致節點(diǎn)逐出。
2.如果服務(wù)器上有接口,子網(wǎng)地址可以通過(guò)命令識別:
$ oifcfg iflist
它列出了網(wǎng)絡(luò )接口及其子網(wǎng)地址。
即使Oracle Clusterware未運行,也可以運行此命令。
請注意,子網(wǎng)地址的格式可能不是x.y.z.0,它可以是x.y.z.24、x.y.z.64或x.y.z.128等。例如,
$ oifcfg iflist
lan1 18.1.2.0
lan2 10.2.3.64 << this is the private network subnet address associated with private network IP: 10.2.3.XX
3.如果是為了添加第二個(gè)專(zhuān)用網(wǎng)絡(luò ),而不是替換現有的專(zhuān)用網(wǎng)絡(luò ),請確保兩個(gè)接口的MTU大小相同,否則實(shí)例啟動(dòng)會(huì )報告錯誤:
ORA-27504: IPC error creating OSD context
ORA-27300: OS system dependent operation:if MTU failed with status: 0
ORA-27301: OS failure message: Error 0
ORA-27302: failure occurred at: skgxpcini2
ORA-27303: additional information: requested interface lan1:801 has a different MTU (1500) than lan3:801 (9000), which is not supported. Check output from ifconfig command
4.對于11gR2及更高版本,不建議在A(yíng)SM或數據庫spfile或pfile中設置cluster_interconnects。
如果出于任何原因設置了此參數,則需要在clusterware關(guān)閉之前將其更改為spfile或pfile中的新私有IP,否則會(huì )由于互連不匹配而導致重新啟動(dòng)期間出現故障。
驗證更改:
Verify the change:
$ oifcfg getif
3.關(guān)閉所有節點(diǎn)上的Oracle Clusterware并用root用戶(hù)禁用Oracle Clusterware自動(dòng)啟動(dòng):
# crsctl stop crs
# crsctl disable crs
4.根據需要在操作系統級別更改網(wǎng)絡(luò )配置,確保更改后所有節點(diǎn)都可以使用新接口。
$ ifconfig -a
$ ping <private hostname>
5.啟用Oracle Clusterware自啟動(dòng)并以root用戶(hù)身份在所有節點(diǎn)上重新啟動(dòng)Oracle Clusterware:
# crsctl enable crs
# crsctl start crs
6.如果需要,移除舊接口:
$ oifcfg delif -global <interfacename>[/<subnet>]
eg:
$ oifcfg delif -global eth0/192.168.0.0
C.適用于帶Flex ASM的12c和18c Oracle Clusterware
C. For 12c and 18c Oracle Clusterware with Flex ASM
請復習以上B部分,注意備注部分,備份如下:
在繼續之前,請在所有群集節點(diǎn)上備份profile.xml,已grid用戶(hù)執行:
$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
$ cp -p profile.xml profile.xml.bk
1.確保Oracle Clusterware正在群集中的所有群集節點(diǎn)上運行
獲取現有信息。例如:
$ oifcfg getif
<interfacename>1 100.17.10.0 global public
<interfacename>0 192.168.0.0 global cluster_interconnect,asm
上面的示例顯示網(wǎng)絡(luò )eth0用于cluster_interconnect和ASM網(wǎng)絡(luò )。
添加新的cluster_interconnect信息:
$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect[,asm]
For example:
A.添加具有相同子網(wǎng)的新接口bond0
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect,asm
B.添加具有相同接口名稱(chēng)但不同子網(wǎng)或新接口名稱(chēng)的新子網(wǎng)
$ oifcfg setif -global eth0/192.68.10.0:cluster_interconnect,asm
or
$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect,asm
如果心跳網(wǎng)絡(luò )和ASM網(wǎng)絡(luò )使用不同的網(wǎng)絡(luò ),則相應地修改它們。
3.由于A(yíng)SMLISTENER正在使用心跳網(wǎng)絡(luò ),修改心跳網(wǎng)絡(luò )將影響ASMLISTENER。
需要使用新的網(wǎng)絡(luò )配置添加新的ASMLISTENER。
如果ASM網(wǎng)絡(luò )的子網(wǎng)未更改,請跳過(guò)此步驟。
3.1. 使用新子網(wǎng)添加新的ASMLISTENER(例如:ASMNEWLSNR_ASM),已grid用戶(hù)執行:
$ srvctl add listener -asmlistener -l <new ASM LISTENER NAME> -subnet <new subnet>
eg:
$ srvctl add listener -asmlistener -l ASMNEWLSNR_ASM -subnet 192.168.10.0
3.2. 刪除現有的ASMLISTENER(本例中為ASMLSNR_ASM)并刪除依賴(lài)項,已grid用戶(hù)執行:
$ srvctl update listener -listener ASMLSNR_ASM -asm -remove -force
$ lsnrctl stop ASMLSNR_ASM
注意-force選項是必需的,否則將發(fā)生以下錯誤:
$ srvctl update listener -listener ASMLSNR_ASM -asm -remove
PRCR-1025 : Resource ora.ASMLSNR_ASM.lsnr is still running
$ srvctl stop listener -l ASMLSNR_ASM
PRCR-1065 : Failed to stop resource ora.ASMLSNR_ASM.lsnr
CRS-2529: Unable to act on 'ora.ASMLSNR_ASM.lsnr' because that would require stopping or relocating 'ora.asm', but the force option was not specified
3.3 驗證配置
$ srvctl config listener -asmlistener
$ srvctl config asm
4.所有節點(diǎn)停止Oracle Clusterware并禁用自動(dòng)啟動(dòng),已root用戶(hù)執行:
# crsctl stop crs
# crsctl disable crs
5.根據需要在操作系統級別更改網(wǎng)絡(luò )配置,確保更改后所有節點(diǎn)都可以使用新接口。
$ ifconfig -a
$ ping <private hostname>
4.所有節點(diǎn)停止Oracle Clusterware并啟用自動(dòng)啟動(dòng)并重啟Clusterware,已root用戶(hù)執行:
# crsctl enable crs
# crsctl start crs
7.如果需要,刪除舊的網(wǎng)絡(luò )接口。
$ oifcfg delif -global <interfacename>[/<subnet>]
eg:
$ oifcfg delif -global <interfacename>0/192.168.0.0
11gR2+需要注意的:
1.如果基礎網(wǎng)絡(luò )配置已更改,但尚未運行oifcfg進(jìn)行相同的更改,則在Oracle Clusterware重新啟動(dòng)時(shí),CRSD將無(wú)法啟動(dòng)。
crsd.log日志顯示如下:
2010-01-30 09:22:47.234: [ default][2926461424] CRS Daemon Starting .. 2010-01-30 09:22:47.273: [ GPnP][2926461424]clsgpnp_Init: [at clsgpnp0.c:837] GPnP client pid=7153, tl=3, f=0 2010-01-30 09:22:47.282: [ OCRAPI][2926461424]clsu_get_private_ip_addresses: no ip addresses found. 2010-01-30 09:22:47.282: [GIPCXCPT][2926461424] gipcShutdownF: skipping shutdown, count 2, from [ clsinet.c : 1732], ret gipcretSuccess (0) 2010-01-30 09:22:47.283: [GIPCXCPT][2926461424] gipcShutdownF: skipping shutdown, count 1, from [ clsgpnp0.c : 1021], ret gipcretSuccess (0) [ OCRAPI][2926461424]a_init_clsss: failed to call clsu_get_private_ip_addr (7) 2010-01-30 09:22:47.285: [ OCRAPI][2926461424]a_init:13!: Clusterware init unsuccessful : [44] 2010-01-30 09:22:47.285: [ CRSOCR][2926461424] OCR context init failure. Error: PROC-44: Error in network address and interface operations Network address and interface operations error [7] 2010-01-30 09:22:47.285: [ CRSD][2926461424][PANIC] CRSD exiting: Could not init OCR, code: 44 2010-01-30 09:22:47.285: [ CRSD][2926461424] Done.
上述錯誤表明操作系統設置(oifcfg iflist)和gpnp profile setting profile.xml之間不匹配。
解決方法:將操作系統網(wǎng)絡(luò )配置恢復到原始狀態(tài),啟動(dòng)Oracle Clusterware。然后按照上述步驟再次進(jìn)行更改。
如果基礎網(wǎng)絡(luò )尚未更改,但oifcfg setif使用錯誤的子網(wǎng)地址或接口名稱(chēng)運行,則會(huì )發(fā)生相同的問(wèn)題。
2.如果集群中的任何一個(gè)節點(diǎn)停機,oifcfg命令將失敗并出現錯誤:
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
PRIF-26: Error in update the profiles in the cluster
解決方法:在Oracle Clusterware未運行的節點(diǎn)上啟動(dòng)Oracle Clusterware。確保所有群集節點(diǎn)上的Oracle Clusterware都已啟動(dòng)。
如果節點(diǎn)因任何操作系統原因關(guān)閉,請在執行專(zhuān)用網(wǎng)絡(luò )更改之前從群集中刪除該節點(diǎn)。
3.如果 Grid Infrastructure所有者以外的用戶(hù)發(fā)出上述命令,它將失敗,并出現相同的錯誤:
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
PRIF-26: Error in update the profiles in the cluster
4.從11.2.0.2開(kāi)始,如果嘗試刪除最后一個(gè)專(zhuān)用接口(群集_互連),而不首先添加新接口,則會(huì )發(fā)生以下錯誤:
PRIF-31: Failed to delete the specified network interface because it is the last private interface
解決方法:在刪除舊的私有接口之前,先添加新的私有接口。.
5.如果節點(diǎn)上的Oracle Clusterware已關(guān)閉,則可能會(huì )出現以下錯誤:
$ oifcfg getif
PRIF-10: failed to initialize the cluster registry
解決方法:在節點(diǎn)上啟動(dòng)Oracle Clusterware
Windows系統的注意事項:
在Windows/RAC集群上更改接口的語(yǔ)法與在Unix/Linux上相同,但接口名稱(chēng)略有不同。在Windows系統上,分配給接口的默認名稱(chēng)通常命名為:
Local Area Connection
Local Area Connection 1
Local Area Connection 2
如果使用的接口名稱(chēng)中有空格,則該名稱(chēng)必須用引號括起來(lái)。
另外,請注意它是區分大小寫(xiě)的。例如,在Windows上,要設置cluster_interconnect:
C:\oracle\product\10.2.0\crs\bin\oifcfg setif -global "Local Area Connection 1"/192.168.1.0:cluster_interconnect
但是,Windows上的最佳做法是將接口重命名為更有意義的接口,例如將其重命名為"ocwpublic"和"ocwprivate"。
如果在安裝Oracle Clusterware后重命名接口名稱(chēng),則需要運行"oifcfg"來(lái)添加新接口并刪除舊接口,如上所述。
通過(guò)運行以下命令,可以查看每個(gè)節點(diǎn)上可用的接口名稱(chēng):
oifcfg iflist -p -n
必須在每個(gè)節點(diǎn)上運行此命令,以驗證定義的接口名稱(chēng)是否相同。
使用oifcfg更改接口名稱(chēng)的后果:
對于心跳接口,數據庫將使用存儲在OCR中的接口,該接口被定義為緩存融合通信的'cluster_interconnect'。
cluster_interconnect信息在啟動(dòng)時(shí)可在警報日志中的參數列表之后獲得,例如:
For pre 11.2.0.2:
Cluster communication is configured to use the following interface(s) for this instance
192.XXX.X.1
For 11.2.0.2+: (HAIP address will show in alert log instead of private IP)
Cluster communication is configured to use the following interface(s) for this instance
169.XXX.XX.97
如果這是不正確的,則需要在更正OCR條目后重新啟動(dòng)實(shí)例。
這同樣適用于A(yíng)SM實(shí)例和數據庫實(shí)例。
在Windows系統上,關(guān)閉實(shí)例后,在重新讀取OCR之前,還需要停止/重新啟動(dòng)OracleService<SID>(或OracleSMService<ASMSID>)。
Oifcfg Usage
要查看oifcfg的完整選項,只需執行:
To see the full options of oifcfg, simply type:
$ <CRS_HOME>/bin/oifcfg
場(chǎng)景十:使用HAIP為11gR2及以上版本添加或刪除cluster_interconnect
1.grid執行,使用HAIP將另一個(gè)專(zhuān)用網(wǎng)絡(luò )添加到現有集群中:
$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect
For example:
$ oifcfg setif -global <interfacename>/192.XXX.XX.0:cluster_interconnect
關(guān)閉所有節點(diǎn)上的CRS,然后重新啟動(dòng)所有節點(diǎn)上的CRS,以便HAIP拾取新接口。
crsctl stop crs
crsctl start crs
不能以滾動(dòng)方式重新啟動(dòng)CRS。
2.要以grid用戶(hù)身份使用HAIP從集群中刪除心跳網(wǎng)絡(luò ),請執行以下操作:
$ oifcfg delif -global <interfacename>
For example:
$ oifcfg delif -global <interfacename>
HAIP將故障切換到剩余接口,并且clusterware/database在刪除接口后繼續運行。
要刪除額外的HAIP接口,需要關(guān)閉所有節點(diǎn)上的CRS,然后重新啟動(dòng)所有節點(diǎn)上的CRS。
crsctl stop crs
crsctl start crs
不能以滾動(dòng)方式重新啟動(dòng)CRS。
如下是MOS相關(guān)文章原文及翻譯:
###########################################################################################################33
How to Modify Public Network Information including VIP in Oracle Clusterware (文檔 ID 276434.1)
目的
PURPOSE
本說(shuō)明旨在說(shuō)明如何在Oracle Clusterware/Grid Infrastructure環(huán)境中更改公共主機名、公共IP、虛擬IP地址(VIP)、VIP主機名或其他VIP屬性。
The purpose of this note is to illustrate how to change a public hostname, public IP, a Virtual IP Address (VIP), VIP hostname or other VIP attributes in an Oracle Clusterware/Grid Infrastructure environment.
范圍
SCOPE
Oracle Database 10g和11g在群集環(huán)境中使用VIP(虛擬IP)讓客戶(hù)端連接到數據庫。
Oracle Database 10g and 11g use VIPs (Virtual IP) in clustered environments for clients to connect to the database.
這些VIP是與(虛擬)主機名關(guān)聯(lián)并通過(guò)DNS解析的靜態(tài)IP地址(使用11gR2 GNS時(shí)除外)。
These VIPs are static IP addresses associated with (virtual) hostnames and resolved through DNS (except when using 11gR2 GNS).
在安裝Oracle Clusterware期間,系統會(huì )提示用戶(hù)為群集中的每個(gè)節點(diǎn)輸入虛擬IP和虛擬主機名。
During the installation of the Oracle Clusterware users are prompted to enter a Virtual IP and Virtual hostname for each of the node in the cluster.
它們存儲在OCR(Oracle群集注冊表)中,HA框架中的不同組件依賴(lài)于這些VIP。
These are stored within the OCR (Oracle Cluster Registry) and different components within the HA framework depend on these VIPs.
如果出于某種原因需要更改VIP、VIP主機名或子網(wǎng)、網(wǎng)絡(luò )掩碼等,則應遵循此過(guò)程。
If for some reason the need arises to change either the VIP, the VIP hostname, or the subnet, netmask etc, this procedure should be followed.
有關(guān)與專(zhuān)用網(wǎng)絡(luò )/群集互連相關(guān)的更改,請參閱注釋283684.1
For changes associated with private network/cluster interconnect, please refer to Note 283684.1
場(chǎng)景一:修改公共主機名
Case I. Changing public hostname
場(chǎng)景二:僅更改公共IP或VIP而不更改接口、子網(wǎng)或網(wǎng)絡(luò )掩碼,或僅更改MAC地址而不更改任何其他內容
Case II. Changing public IP or VIP only without changing interface, subnet or netmask or changing MAC address only without changing anything else
場(chǎng)景三:更改公共網(wǎng)絡(luò )接口、子網(wǎng)或網(wǎng)絡(luò )掩碼
Case III. Changing public network interface, subnet or netmask
場(chǎng)景四:與公共網(wǎng)絡(luò )變更相關(guān)的VIP變更
Case IV. Changing VIPs associated with public network change
場(chǎng)景五:更改與公用網(wǎng)絡(luò )更改關(guān)聯(lián)的SCAN VIP
Case V. Change SCAN VIP associated with public network change
場(chǎng)景一:修改公共主機名
Case I. Changing public hostname
公共主機名記錄在OCR中,在安裝階段輸入。
Public hostname is recorded in OCR, it is entered during installation phase.
安裝后無(wú)法對其進(jìn)行修改。
It can not be modified after the installation.
修改公共主機名的唯一方法是刪除節點(diǎn),然后使用新主機名重新添加節點(diǎn),或者重新安裝clusterware,或者按照克隆過(guò)程重新配置clusterware。
The only way to modify public hostname is by deleting the node, then adding the node back with a new hostname, or reinstalling the clusterware or following the clone procedure to reconfigure the clusterware.
場(chǎng)景二:僅更改公共IP或VIP而不更改接口、子網(wǎng)或網(wǎng)絡(luò )掩碼,或僅更改MAC地址而不更改任何其他內容
Case II. Changing public IP or VIP only without changing interface, subnet or netmask or changing MAC address only without changing anything else
如果更改僅為公共IP或VIP地址,且新地址仍在同一子網(wǎng)、同一接口中,或者如果更改僅為公共IP MAC地址、IP/接口/子網(wǎng)/網(wǎng)絡(luò )掩碼均保持不變,則無(wú)需在clusterware層執行任何操作,所有更改都需要在OS層執行以反映更改。
If the change is only public IP or VIP address and the new ones are still in the same subnet, same interface, or if the change is only for public IP MAC address, IP/interface/subnet/netmask all remain the same, nothing needs to be done at clusterware layer, all changes need to be done at OS layer to reflect the change.
1.關(guān)閉Oracle Clusterware堆棧
1. Shutdown Oracle Clusterware stack
2.修改網(wǎng)絡(luò )層的IP地址、DNS和/etc/hosts文件以反映更改或修改網(wǎng)絡(luò )層的MAC地址
2. Modify the IP address at network layer, DNS and /etc/hosts file to reflect the change or modify the MAC address at network layer
3.重新啟動(dòng)Oracle Clusterware堆棧
3. Restart Oracle Clusterware stack
上述更改可以滾動(dòng)方式完成,例如:一次一個(gè)節點(diǎn)。
Above change can be done in rolling fashion, eg: one node at a time.
場(chǎng)景三:更改公共網(wǎng)絡(luò )接口、子網(wǎng)或網(wǎng)絡(luò )掩碼
Case III. Changing public network interface, subnet or netmask
如果更改涉及不同的子網(wǎng)(網(wǎng)絡(luò )掩碼)或接口,請從OCR中刪除現有接口信息,并使用正確的信息重新添加。
If the change involves different subnet(netmask) or interface, delete the existing interface information from OCR and add it back with the correct information is required.
在此示例中,通過(guò)兩個(gè)單獨的命令將子網(wǎng)從10.2.156.0更改為10.2.166.0,首先執行"delif",然后執行"setif":
In the example here, the subnet is changed from 10.2.156.0 to 10.2.166.0 via two separate commands - first a 'delif' followed by a 'setif':
% $CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>]
% $CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:public
For example:
% $CRS_HOME/bin/oifcfg delif -global eth0/10.X.156.0
% $CRS_HOME/bin/oifcfg setif -global eth0/10.X.166.0:public
然后在操作系統層進(jìn)行更改。
Then make the change at OS layer.
除非操作系統更改需要重新啟動(dòng)節點(diǎn),否則不需要重新啟動(dòng)Oracle clusterware。
There is no requirement to restart Oracle clusterware unless OS change requires a node reboot.
這可以通過(guò)滾動(dòng)方式完成。
This can be done in rolling fashion.
一旦public網(wǎng)絡(luò )發(fā)生變更,其關(guān)聯(lián)VIP和SCN VIP也需要變更,參見(jiàn)案例四和案例五。
Once public network is changed, its associated VIP and SCAN VIP are also required to change, refer to CASE IV and CASE V.
注意:對于11gR2,上述命令要求clusterware在所有節點(diǎn)上運行,否則將報告PRIF-33和PRIF-32,即:
Note: for 11gR2, above command requires clusterware RUNNING on ALL nodes, otherwise PRIF-33 and PRIF-32 will be reported, i.e.
[grid@racnode1 bin]$ ./oifcfg delif -global <if_name>/192.168.1.0
PRIF-33: Failed to set or delete interface because hosts could not be discovered
CRS-02307: No GPnP services on requested remote hosts.
PRIF-32: Error in checking for profile availability for host <nodename>2
CRS-02306: GPnP service on host "<nodename>2" not found.
場(chǎng)景四:與公共網(wǎng)絡(luò )變更相關(guān)的VIP變更
Case IV. Changing VIPs associated with public network change
VIP變更計劃
Planning for VIP changes
一般來(lái)說(shuō),只有在10.2.0.3版本之前的版本中才需要完全停機。
In general, a complete outage is only required for pre-10.2.0.3 release.
從10.2.0.3開(kāi)始,ASM/數據庫實(shí)例對VIP資源的依賴(lài)關(guān)系將被刪除,因此可以在不必關(guān)閉ASM/數據庫實(shí)例的情況下修改VIP,當VIP關(guān)閉時(shí),只有到數據庫的客戶(hù)端連接將受到影響。
From 10.2.0.3 onwards, the ASM/database instance dependency on the VIP resource is removed, so the VIP could be modified without having to take down the ASM/database instance, only client connections to the database will be affected when VIP is down.
如果修改是特定于節點(diǎn)的,那么在更改期間,只有與該節點(diǎn)的連接才會(huì )受到影響。
If the modification is a node specific, then only connection to that node will be affected during the time of change.
請遵循案例三,以確保公共網(wǎng)絡(luò )已更改。
Please follow Case III to ensure public network changes are made first.
如果操作系統網(wǎng)絡(luò )更改后節點(diǎn)重新啟動(dòng)或Clusterware重新啟動(dòng),vip將不會(huì )啟動(dòng),請跳到"Modifying VIP and its Associated Attributes"步驟。
If there is a node reboot or Clusterware restart after the OS network change, vip will not start, please skip to step "Modifying VIP and its Associated Attributes".
收集當前VIP配置
Gathering Current VIP Configuration
1.收集現有設置
1.Gather the existing setup
對于10g和11gR1,作為Oracle Clusterware所有者:
for 10g and 11gR1, as Oracle Clusterware owner:
$ srvctl config nodeapps -n <nodename> -a
eg:
$ srvctl config nodeapps -n <nodename>1 -a
VIP exists.: /<nodename>1-vip/101.XX.XX.184/255.255.254.0/<if_name>
對于11gR2,作為Oracle Clusterware所有者:
for 11gR2, as Grid Infrastructure owner:
$ srvctl config nodeapps -a
eg:
$ srvctl config nodeapps -a
Network exists: 1/101.17.80.0/255.255.254.0/<if_name>, type static
VIP exists: /racnode1-vip/101.17.XX.184/101.17.80.0/255.255.254.0/<if_name>, hosting node <nodename>1
VIP exists: /racnode2-vip/101.17.XX.186/101.17.80.0/255.255.254.0/<if_name>, hosting node <nodename>2
2.驗證VIP狀態(tài)
2. Verify VIP status
10.2 and 11.1:
$ crs_stat -t
11.2:
$ crsctl stat res -t
-它應該顯示VIPs在線(xiàn)
- it should show VIPs are ONLINE
$ ifconfig -a
(netstat -in for HP and ipconfig /all for Windows)
-VIP邏輯接口綁定到公共網(wǎng)絡(luò )接口
- VIP logical interface is bound to the public network interface
停止資源
Stopping Resources
3.停止nodeapps資源(以及所有從屬資源ASM/DB,僅在需要時(shí)):
3. Stop the nodeapps resources (and all dependent resources ASM/DB only if required):
10g and 11gR1, as Oracle Clusterware owner:
$ srvctl stop instance -d <db_name> -i <inst_name> (optional for 10.2.0.3+)
$ srvctl stop asm -n <node_name> (optional for 10.2.0.3+)
$ srvctl stop nodeapps -n <node_name>
eg,
$ srvctl stop instance -d <DBNAME> -i <INSTANCENAME>
$ srvctl stop asm -n <nodename>1
$ srvctl stop nodeapps -n <nodename>1
11gR2, as Grid Infrastructure owner:
$ srvctl stop instance -d <db_name> -n <node_name> (optional)
$ srvctl stop vip -n <node_name> -f
eg,
$ srvctl stop instance -d <DBNAME> -n <nodename>1
$ srvctl stop vip -n <nodename>1 -f
注1:11gR2需要-f選項來(lái)停止偵聽(tīng)器資源,否則將發(fā)生以下錯誤:
Note 1: The -f option is required for 11gR2 to stop listener resource, otherwise following error will occur:
PRCR-1014 : Failed to stop resource ora.<nodename>1.vip
PRCR-1065 : Failed to stop resource ora.<nodename>1.vip
CRS-2529: Unable to act on 'ora.<nodename>1.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
...
4.驗證VIP現在處于脫機狀態(tài),并且該接口不再綁定到公共網(wǎng)絡(luò )接口
4. Verify VIP is now OFFLINE and the interface is no longer bound to the public network interface
$ crs_stat -t (or $ crsctl stat res -t for 11gR2)
$ ifconfig -a
(netstat -in for HP and ipconfig /all for windows)
修改VIP及其關(guān)聯(lián)屬性
Modifying VIP and Its Associated Attributes
5.確定新的VIP IP/子網(wǎng)/網(wǎng)絡(luò )掩碼或VIP主機名,首先在操作系統上更改網(wǎng)絡(luò ),確保新VIP已在DNS中注冊或在/etc/hosts(對于Unix/Linux)和\WINDOWS\System32\drivers\etc\hosts文件(對于WINDOWS)中修改。
5. Determine the new VIP IP/subnet/netmask or VIP hostname, make the network change on OS first, ensure the new VIP is registered in DNS or modified in /etc/hosts (for Unix/Linux) and \WINDOWS\System32\drivers\etc\hosts file (for Windows).
如果網(wǎng)絡(luò )接口已更改,請確保新接口在服務(wù)器上可用,然后再繼續修改。
If the network interface is changed, ensure the new interface is available on the server before proceeding with the modification.
For example:
New VIP is: 110.XX.XX.11 <nodename>1-nvip
new subnet is 110.11.70.0
new netmask is 255.255.255.0
new interface is <if_name>
6.以root用戶(hù)身份修改VIP資源:
6. Modify the VIP resource, as root user:
# srvctl modify nodeapps -n <node> -A <new_vip_address or new_vip_hostname>/<netmask>/<[if1[if2...]]>
eg:
# srvctl modify nodeapps -n <nodename>1 -A <nodename>1-nvip/255.255.255.0/<if_name>
注1:從11.2開(kāi)始,VIP取決于網(wǎng)絡(luò )資源(ora.net1.network),OCR僅記錄VIP主機名或與VIP資源關(guān)聯(lián)的IP地址。
Note 1: Starting with 11.2, the VIPs depend on the network resource (ora.net1.network), the OCR only records the VIP hostname or the IP address associated with the VIP resource.
網(wǎng)絡(luò )屬性(子網(wǎng)/網(wǎng)絡(luò )掩碼/接口)與網(wǎng)絡(luò )資源一起記錄。
The network attributes (subnet/netmask/interface) are recorded with the network resource.
修改nodeapps資源時(shí),網(wǎng)絡(luò )資源(ora.net1.network)屬性也會(huì )隱式修改。
When the nodeapps resource is modified, the network resoure(ora.net1.network) attributes are also modified implicitly.
從11.2.0.2開(kāi)始,如果只需要更改子網(wǎng)/網(wǎng)絡(luò )掩碼/接口,則可以通過(guò)srvctl modify網(wǎng)絡(luò )命令直接修改網(wǎng)絡(luò )資源。
From 11.2.0.2 onwards, if only subnet/netmask/interface change is required, network resource can be modified directly via srvctl modify network command.
as root user:
# srvctl modify network -k <network_number>] [-S <subnet>/<netmask>[/if1[|if2...]]
eg:
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0/<if_name>
如果其他屬性未更改,則無(wú)需修改VIP或SCAN。
There is no need to modify VIP or SCAN if other attributes are not changed.
注2:對于12.1.0.1版本,由于未發(fā)布的BUG 16608577-無(wú)法在ORACLE 12.1中添加第二個(gè)公共接口,srvctl modify網(wǎng)絡(luò )命令失敗,原因是:
Note 2: For 12.1.0.1 release, due to unpublished Bug 16608577 - CANNOT ADD SECOND PUBLIC INTERFACE IN ORACLE 12.1, the srvctl modify network command fails with:
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0/<if_name>
PRCT-1305 : The specified interface name "<if_name>2" does not match the existing network interface name "<if_name>1"
解決方法是使用空接口名稱(chēng)修改網(wǎng)絡(luò )資源,然后使用所需的接口名稱(chēng)再次修改它,例如:
Workaround is to modify network resource with an empty interface name, then modify it again with the desired interface name, eg:
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0
# srvctl modify network -k 1 -S 110.XX.XX.0/255.255.255.0/<if_name>2
該錯誤已在12.1.0.2及更高版本中修復。
The bug has been fixed in 12.1.0.2 and above.
*11gR2僅修改VIP主機名而不更改IP地址的特殊情況。
* A special case for 11gR2 modifying the VIP hostname only without changing the IP address.
例如:只有VIP主機名從<nodename>1-VIP更改為<nodename>1-nvip,IP和其他屬性保持不變。
For example: only VIP hostname changes from <nodename>1-vip to <nodename>1-nvip, IP and other attributes remain the same.
如果IP地址未更改,上述修改命令將不會(huì )更改“crsctl stat res ORA.<nodename>.VIP-p”輸出中的USR_ORA_VIP值。
If IP address is not changed, above modify command will not change the USR_ORA_VIP value in 'crsctl stat res ora.<nodename>.vip -p' output.
請使用以下命令:
Please use the following command:
# crsctl modify res ora.<nodename>.vip -attr USR_ORA_VIP=<nodename>1-nvip
驗證USR_ORA_VIP字段的更改:
Verify the changes for USR_ORA_VIP field:
# crsctl stat res ora.<nodename>1.vip -p |grep USR_ORA_VIP
注意:對于Windows平臺,如果中間有空格,則接口名稱(chēng)需要在引號(“)中,例如:
Note: For Windows platform, the interface name needs to be in quote (") if there is a space in between, eg:
作為管理員用戶(hù)或軟件安裝用戶(hù):
As administrator user or software install user:
> srvctl modify nodeapps -n <nodename> -A 110.XX.XX.11/255.255.255.0/"Local Area Connection 1"
7.驗證更改
7. Verify the change
$ srvctl config nodeapps -n <node> -a (10g and 11gR1)
$ srvctl config nodeapps -a (11gR2)
eg:
$ srvctl config nodeapps -n <nodename>1 -a
VIP exists.: /<nodename>1-nvip/110.11.70.11/255.255.255.0/<if_name>2
重啟資源
Restarting Resources
8.啟動(dòng)nodeapps和其他資源
8. Start the nodeapps and the other resources
10g and 11gR1, as Oracle Clusterware owner:
$ srvctl start nodeapps -n <node_name>
$ srvctl start asm -n <node_name> (optional for 10.2.0.3+)
$ srvctl start instance -d <dbanme> -i <inst> (optional for 10.2.0.3+)
eg:
$ srvctl start nodeapps -n <nodename>1
$ srvctl start asm -n <nodename>1
$ srvctl start instance -d <DBNAME> -i <INSTANCENAME>1
11gR2, as Grid Infrastructure owner:
$ srvctl start vip -n <node_name>
$ srvctl start listener -n <node_name>
$ srvctl start instance -d <db_name> -n <node_name> (optional)
eg,
$ srvctl start vip -n <nodename>1
$ srvctl start listener -n <nodename>1
$ srvctl start instance -d <DBNAME> -n <nodename>1
注意:如果更改了網(wǎng)絡(luò )屬性,即更改了網(wǎng)絡(luò )掩碼,請重新啟動(dòng)nodeapps
Note: if the network attributes are changed, i.e. netmask changed, restart the nodeapps
9.驗證新VIP是否在線(xiàn)并綁定到公共網(wǎng)絡(luò )接口
9. Verify the new VIP is ONLINE and bind to the public network interface
$ crs_stat -t (or $ crsctl stat res -t for 11gR2)
$ ifconfig -a
(netstat -in for HP or ipconfig /all for windows)
僅當需要進(jìn)行類(lèi)似更改時(shí),才對群集中的rest節點(diǎn)重復相同的步驟。
10. Repeat the same steps for the rest nodes in the cluster only if the similar change is required.
其他
Others
11.如有必要,修改listener.ora, tnsnames.ora and LOCAL_LISTENER/REMOTE_LISTENER參數以反映VIP更改。
11. Modify listener.ora, tnsnames.ora and LOCAL_LISTENER/REMOTE_LISTENER parameter to reflect the VIP change if necessary.
注意,ASM和DB的LOCAL_LISTENER由Grid Infrastructure自動(dòng)設置。
Note, LOCAL_LISTENER for ASM and DB are set automatically by Grid Infrastructure.
LOCAL_LISTENER中的VIP更改應自動(dòng)生效。
The VIP change in LOCAL_LISTENER should take effect automatically.
由于Bug 22824602,在某些條件下,ASM實(shí)例的LOCAL_LISTENER可能無(wú)法反映VIP更改。
Due to Bug 22824602, under some race condition, the LOCAL_LISTENER for ASM instance might not reflect the VIP change.
解決方法是在受影響的節點(diǎn)上重新啟動(dòng)Clusterware。
The workaround is to restart the Clusterware on the affected node.
場(chǎng)景五:更改與公用網(wǎng)絡(luò )更改關(guān)聯(lián)的SCAN VIP
Case V. Change SCAN VIP associated with public network change
在Grid Infrastructure 11gR2中,為客戶(hù)端連接引入了SCAN和SACN VIP。要修改SCAN VIP,請參閱:
With Grid Infrastructure 11gR2, SCAN and SCAN VIP are introduced for client connections. To modify the SCAN VIP, please refer to
Note 952903.1 How to update the IP address of the SCAN VIP resources (ora.scan<n>.vip)
Note 972500.1 How to Modify SCAN Setting or SCAN Listener Port after Installation
注意:如果需要回滾更改,請重復已運行的命令,用原始值替換新值以恢復原始配置。
Note: if rolling back the change is required, repeat the commands which have been run, replace the new value with original value to restore the original configuration.
##########################################
How to Modify Private Network Information in Oracle Clusterware (文檔 ID 283684.1)
場(chǎng)景一:修改私有網(wǎng)卡主機名
Case I. Changing private hostname
場(chǎng)景二:僅更改私有IP而不更改網(wǎng)絡(luò )接口、子網(wǎng)和網(wǎng)絡(luò )掩碼或者只更改專(zhuān)用IP MAC地址而不更改其他任何內容
Case II. Changing private IP only without changing network interface, subnet and netmask or changing private IP MAC address only without changing anything else
場(chǎng)景三:僅更改私有網(wǎng)絡(luò )MTU
Case III. Changing private network MTU only
場(chǎng)景四:更改私有網(wǎng)絡(luò )接口名稱(chēng)、子網(wǎng)或網(wǎng)絡(luò )掩碼
場(chǎng)景五:使用HAIP為11gR2及以上版本添加或刪除cluster_interconnect
Case V. Add or remove cluster_interconnect for 11gR2 and above with HAIP
目標:
GOAL
本說(shuō)明的目的是描述如何更改或更新Oracle Clusterware中的心跳網(wǎng)絡(luò )(群集互連)信息。
The purpose of this note is to describe how to change or update the private network (cluster_interconnect) information in Oracle Clusterware.
如果存在影響服務(wù)器的網(wǎng)絡(luò )更改,或者如果在安裝過(guò)程中輸入的原始信息不正確,則可能需要更改或更新接口名稱(chēng)或與接口關(guān)聯(lián)的子網(wǎng)。
It may be necessary to change or update interface names, or subnet associated with an interface if there is a network change affecting the servers, or if the original information that was input during the installation was incorrect.
也可能是由于某種原因,Oracle Interface Configuration Assistant(“oifcfg”)在安裝過(guò)程中未成功。
It may also be the case that for some reason, the Oracle Interface Configuration Assistant ('oifcfg') did not succeed during the installation.
有關(guān)修改公共網(wǎng)絡(luò )和VIP相關(guān)信息,請參閱注釋276434.1;有關(guān)IPv4子網(wǎng)和Oracle Clusterware的基本信息,請參閱注釋1386709.1。
Please refer to Note 276434.1 for modifying public network and VIP associated information and refer to Note 1386709.1 for basics of IPv4 subnet and Oracle Clusterware.
注意:對于Oracle Engineered system(Exadata)和Oracle Database Appliance(ODA),請不要在本說(shuō)明之后進(jìn)行此類(lèi)更改。
Note: for Oracle Engineered system (Exadata) and Oracle Database Appliance (ODA), please do not make such changes following this note.
解決方案:
SOLUTION
Oracle Clusterware的網(wǎng)絡(luò )信息(接口、子網(wǎng)和每個(gè)接口的角色)由"oifcfg"管理,但每個(gè)接口的實(shí)際IP地址不是,"oifcfg"無(wú)法更新IP地址信息。
Network information(interface, subnet and role of each interface) for Oracle Clusterware is managed by 'oifcfg', but actual IP address for each interfaces are not, 'oifcfg' can not update IP address information.
"oifcfg getif"可用于查找OCR中當前配置的接口:
'oifcfg getif' can be used to find out currently configured interfaces in OCR:
% $CRS_HOME/bin/oifcfg getif
<interfacename>0 10.X.XXX.0 global public
<interfacename>1 192.XXX.X.0 global cluster_interconnect
在Unix/Linux系統上,接口名稱(chēng)通常由操作系統分配,標準名稱(chēng)因平臺而異。
On Unix/Linux systems, the interface names are generally assigned by the OS, and standard names vary by platform.
對于Windows系統,請參閱下面的附加說(shuō)明。
For Windows systems, see additional notes below.
上面的示例顯示當前接口<interfacename>0用于子網(wǎng)10.2.156.0的公用,而<interfacename>1用于子網(wǎng)192.168.0.0的群集互連/專(zhuān)用。
Above example shows currently interface <interfacename>0 is used for public with subnet 10.2.156.0, and <interfacename>1 for cluster_interconnect/private with subnet 192.168.0.0.
"public"網(wǎng)絡(luò )用于數據庫客戶(hù)端通信(VIP也使用相同的網(wǎng)絡(luò ),盡管它作為單獨條目存儲在OCR中),而"cluster_interconnect"網(wǎng)絡(luò )用于RDBMS/ASM緩存融合。
The 'public' network is for database client communication (VIP also uses the same network though it's stored in OCR as separate entry), whereas the 'cluster_interconnect' network is for RDBMS/ASM cache fusion.
從11gR2開(kāi)始,cluster_interconnect還用于clusterware心跳-與之前的版本相比,這是一個(gè)重大變化,因為11gR2之前的版本使用了在安裝clusterware心跳時(shí)指定的專(zhuān)用節點(diǎn)名。
Starting with 11gR2, cluster_interconnect is also used for clusterware heartbeats - this is significant change compare to prior release as pre-11gR2 uses the private nodename that were specified at installation time for clusterware heartbeats.
如果"cluster_interconnect"接口的子網(wǎng)或接口名稱(chēng)不正確,則需要將其更改為crs/grid user。
If the subnet or interface name for 'cluster_interconnect' interface is incorrect, it needs to be changed as crs/grid user.
場(chǎng)景一:修改私有網(wǎng)卡主機名
Case I. Changing private hostname
在11.2版之前的Oracle Clusterware中,心跳主機名記錄在OCR中,無(wú)法更新。通常,不需要更改心跳主機名。
In pre-11.2 Oracle Clusterware, private hostname is recorded in OCR, it can not be updated. Generally private hostname is not required to change.
可以更改其關(guān)聯(lián)的IP。更改私有主機名的唯一方法是刪除/添加節點(diǎn),或重新安裝Oracle Clusterware。
Its associated IP can be changed. The only way to change private hostname is by deleting/adding nodes, or reinstall Oracle Clusterware.
在11.2網(wǎng)格基礎設施中,心跳主機名不再記錄在OCR中,并且不依賴(lài)于心跳主機名。
In 11.2 Grid Infrastructure, private hostname is no longer recorded in OCR and there is no dependency on the private hostname.
它可以在/etc/hosts中自由更改。
It can be changed freely in /etc/hosts.
場(chǎng)景二:僅更改私有IP而不更改網(wǎng)絡(luò )接口、子網(wǎng)和網(wǎng)絡(luò )掩碼或者只更改專(zhuān)用IP MAC地址而不更改其他任何內容
Case II. Changing private IP only without changing network interface, subnet and netmask or changing private IP MAC address only without changing anything else
例如,私有IP從192.XXX.X.10更改為192.XXX.X.21,網(wǎng)絡(luò )接口名稱(chēng)和子網(wǎng)保持不變,或者M(jìn)AC地址更改,專(zhuān)用IP地址/接口名稱(chēng)/子網(wǎng)/網(wǎng)絡(luò )都保持不變。
For example, private IP is changed from 192.XXX.X.10 to 192.XXX.X.21, network interface name and subnet remain the same, or MAC address is changed, private IP address/interface name/subnet/network all remain the same.
只需在需要更改的節點(diǎn)上關(guān)閉Oracle Clusterware堆棧,根據需要在操作系統層(例如:/etc/hosts、操作系統網(wǎng)絡(luò )配置等)對私有網(wǎng)絡(luò )進(jìn)行IP或MAC修改,重新啟動(dòng)Oracle Clusterware堆棧即可完成任務(wù)。
Simply shutdown Oracle Clusterware stack on the node where change required, make IP or MAC modification at OS layer as required (eg: /etc/hosts, OS network config etc) for private network, restart Oracle Clusterware stack will complete the task.
場(chǎng)景三:僅更改私有網(wǎng)絡(luò )MTU
Case III. Changing private network MTU only
例如,私有網(wǎng)絡(luò )MTU從1500更改為9000(啟用巨型幀),網(wǎng)絡(luò )接口名稱(chēng)和子網(wǎng)保持不變。
For example, private network MTU is changed from 1500 to 9000 (enable jumbo frame), network interface name and subnet remain the same.
1.關(guān)閉所有節點(diǎn)上的Oracle Clusterware堆棧
1. Shutdown Oracle Clusterware stack on all nodes
2.在操作系統網(wǎng)絡(luò )層對MTU大小進(jìn)行所需的網(wǎng)絡(luò )更改,確保心跳網(wǎng)絡(luò )具有所需的MTU大小,在所有群集節點(diǎn)上使用所需的MTU大小進(jìn)行ping
2. Make the required network change of MTU size at OS network layer, ensure private network is available with the desired MTU size, ping with the desired MTU size works on all cluster nodes
3.在所有節點(diǎn)上重新啟動(dòng)Oracle Clusterware堆棧
3. Restart Oracle Clusterware stack on all nodes
場(chǎng)景四:更改私有網(wǎng)絡(luò )接口名稱(chēng)、子網(wǎng)或網(wǎng)絡(luò )掩碼
Case IV. Changing private network interface name, subnet or netmask
注意:更改網(wǎng)絡(luò )掩碼但子網(wǎng)ID不變時(shí),例如:
Note: When the netmask is changed but the subnet ID doesn't change, for example:
網(wǎng)絡(luò )掩碼從255.255.0.0更改為255.255.255.0,心跳IP為192.168.0.x,子網(wǎng)ID與192.168.0.0相同,網(wǎng)絡(luò )接口名稱(chēng)不變。
The netmask is changed from 255.255.0.0 to 255.255.255.0 with private IP like 192.168.0.x, the subnet ID remains the same as 192.168.0.0, the network interface name is not changed.
在需要更改的所有群集節點(diǎn)上關(guān)閉Oracle Clusterware堆棧,在操作系統層(例如:操作系統網(wǎng)絡(luò )配置等)對心跳網(wǎng)絡(luò )進(jìn)行IP修改,在所有節點(diǎn)上重新啟動(dòng)Oracle Clusterware堆棧將完成任務(wù)。
Shutdown Oracle Clusterware stack on all cluster nodes where change required, make IP modification at OS layer (eg: OS network config etc) for private network, restart Oracle Clusterware stack on all nodes will complete the task.
請注意,此更改不能以滾動(dòng)方式進(jìn)行。
Please note, this change can not be done in rolling manner.
更改網(wǎng)絡(luò )掩碼時(shí),關(guān)聯(lián)的子網(wǎng)ID通常會(huì )更改。
When the netmask is changed, the associated subnet ID is often changed.
Oracle僅在OCR中存儲網(wǎng)絡(luò )接口名稱(chēng)和子網(wǎng)ID,而不是網(wǎng)絡(luò )掩碼。
Oracle only store network interface name and subnet ID in OCR, not the netmask.
Oifcfg命令可用于此類(lèi)更改,Oifcfg命令只需要在集群節點(diǎn)的1個(gè)節點(diǎn)上運行,而不需要在所有節點(diǎn)上運行。
Oifcfg command can be used for such change, oifcfg commands only require to run on 1 of the cluster node, not all.
A.對于11gR2之前的Oracle Clusterware
A. For pre-11gR2 Oracle Clusterware
1.使用oifcfg添加新的專(zhuān)用網(wǎng)絡(luò )信息,刪除舊的專(zhuān)用網(wǎng)絡(luò )信息:
1. Use oifcfg to add the new private network information, delete the old private network information:
% $ORA_CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:cluster_interconnect
% $ORA_CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>]]
For example:
% $ORA_CRS_HOME/bin/oifcfg setif -global <interfacename>3/192.168.2.0:cluster_interconnect
% $ORA_CRS_HOME/bin/oifcfg delif -global <interfacename>1/192.168.1.0
驗證更改
To verify the change
% $ORA_CRS_HOME/bin/oifcfg getif
eth0 10.X.XXX.0 global public
eth3 192.XXX.2.0 global cluster_interconnect
2.關(guān)閉Oracle Clusterware堆棧
2. Shutdown Oracle Clusterware stack
As root user: # crsctl stop crs
3.在操作系統級別進(jìn)行所需的網(wǎng)絡(luò )更改,應在所有節點(diǎn)上修改/etc/hosts文件以反映更改。
3. Make required network change at OS level, /etc/hosts file should be modified on all nodes to reflect the change.
確保新網(wǎng)絡(luò )在所有群集節點(diǎn)上可用:
Ensure the new network is available on all cluster nodes:
% ping <private hostname/IP>
% ifconfig -a on Unix/Linux
or
% ipconfig /all on windows
4.重啟Oracle Clusterware堆棧
4. restart the Oracle Clusterware stack
As root user: # crsctl start crs
注意:如果在Linux上運行OCFS2,可能還需要更改OCFS2用于與其他節點(diǎn)通信的心跳IP地址。
Note: If running OCFS2 on Linux, one may also need to change the private IP address that OCFS2 is using to communicate with other nodes.
有關(guān)更多信息,請參閱Note 604958.1
For more information, please refer to Note 604958.1
B.適用于不帶Flex ASM的11gR2 Oracle Clusterware和12c群集
B. For 11gR2 Oracle Clusterware and 12c Cluster without Flex ASM
從11.2 Grid Infrastructure,心跳網(wǎng)絡(luò )配置不僅存儲在OCR中,還存儲在gpnp profile文件中。
As of 11.2 Grid Infrastructure, the private network configuration is not only stored in OCR but also in the gpnp profile.
如果心跳網(wǎng)絡(luò )不可用或其定義不正確,CRSD過(guò)程將不會(huì )啟動(dòng),OCR的任何后續更改將不可能進(jìn)行。
If the private network is not available or its definition is incorrect, the CRSD process will not start and any subsequent changes to the OCR will be impossible.
因此,在修改心跳網(wǎng)絡(luò )的配置時(shí)需要小心。
Therefore care needs to be taken when making modifications to the configuration of the private network.
以正確的順序執行更改非常重要。
It is important to perform the changes in the correct order.
還請注意,不支持手動(dòng)修改gpnp profile文件。
Please also note that manual modification of gpnp profile is not supported.
在繼續之前,請在所有群集節點(diǎn)上備份profile.xml,已grid用戶(hù)執行:
Please take a backup of profile.xml on all cluster nodes before proceeding, as grid user:
$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
$ cp -p profile.xml profile.xml.bk
1.確保Oracle Clusterware正在群集中的所有群集節點(diǎn)上運行
1. Ensure Oracle Clusterware is running on ALL cluster nodes in the cluster
2.已grid用戶(hù)執行:
2. As grid user:
獲取現有信息。例如:
Get the existing information. For example:
$ oifcfg getif
<interfacename>1 100.17.10.0 global public
<interfacename>0 192.168.0.0 global cluster_interconnect
添加新的cluster_interconnect信息:
Add the new cluster_interconnect information:
$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect
For example:
A.添加具有相同子網(wǎng)的新接口bond0
a. add a new interface bond0 with the same subnet
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
B.添加具有相同接口名稱(chēng)但不同子網(wǎng)或新接口名稱(chēng)的新子網(wǎng)
b. add a new subnet with the same interface name but different subnet or new interface name
$ oifcfg setif -global eth0/192.65.0.0:cluster_interconnect
or
$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect
1.即使接口還不可用,也可以使用-global選項完成此操作,但如果接口不可用,則無(wú)法使用-node選項完成此操作,這將導致節點(diǎn)逐出。
1. This can be done with -global option even if the interface is not available yet, but this can not be done with -node option if the interface is not available, it will lead to node eviction.
2.如果服務(wù)器上有接口,子網(wǎng)地址可以通過(guò)命令識別:
2. If the interface is available on the server, subnet address can be identified by command:
$ oifcfg iflist
它列出了網(wǎng)絡(luò )接口及其子網(wǎng)地址。即使Oracle Clusterware未運行,也可以運行此命令。
It lists the network interface and its subnet address. This command can be run even if Oracle Clusterware is not running.
請注意,子網(wǎng)地址的格式可能不是x.y.z.0,它可以是x.y.z.24、x.y.z.64或x.y.z.128等。例如,
Please note, subnet address might not be in the format of x.y.z.0, it can be x.y.z.24, x.y.z.64 or x.y.z.128 etc. For example,
$ oifcfg iflist
lan1 18.1.2.0
lan2 10.2.3.64 << this is the private network subnet address associated with private network IP: 10.2.3.XX
3.如果是為了添加第二個(gè)專(zhuān)用網(wǎng)絡(luò ),而不是替換現有的專(zhuān)用網(wǎng)絡(luò ),請確保兩個(gè)接口的MTU大小相同,否則實(shí)例啟動(dòng)會(huì )報告錯誤:
3. If it is for adding a 2nd private network, not replacing the existing private network, please ensure MTU size of both interfaces are the same, otherwise instance startup will report error:
ORA-27504: IPC error creating OSD context
ORA-27300: OS system dependent operation:if MTU failed with status: 0
ORA-27301: OS failure message: Error 0
ORA-27302: failure occurred at: skgxpcini2
ORA-27303: additional information: requested interface lan1:801 has a different MTU (1500) than lan3:801 (9000), which is not supported. Check output from ifconfig command
4.對于11gR2及更高版本,不建議在A(yíng)SM或數據庫spfile或pfile中設置cluster_interconnects。
4. For 11gR2 and higher, it is not recommended to set cluster_interconnects in ASM or Database spfile or pfile.
如果出于任何原因設置了此參數,則需要在clusterware關(guān)閉之前將其更改為spfile或pfile中的新私有IP,否則會(huì )由于互連不匹配而導致重新啟動(dòng)期間出現故障。
If this parameter is set for any reason, it needs to be changed to the new private IP in spfile or pfile prior to clusterware shutdown, otherwise it will result a failure during restart due to the interconnect mismatch.
驗證更改:
Verify the change:
$ oifcfg getif
3.關(guān)閉所有節點(diǎn)上的Oracle Clusterware并用root用戶(hù)禁用Oracle Clusterware自動(dòng)啟動(dòng):
3. Shutdown Oracle Clusterware on all nodes and disable the Oracle Clusterware as root user:
# crsctl stop crs
# crsctl disable crs
4.根據需要在操作系統級別更改網(wǎng)絡(luò )配置,確保更改后所有節點(diǎn)都可以使用新接口。
4. Make the network configuration change at OS level as required, ensure the new interface is available on all nodes after the change.
$ ifconfig -a
$ ping <private hostname>
5.啟用Oracle Clusterware自啟動(dòng)并以root用戶(hù)身份在所有節點(diǎn)上重新啟動(dòng)Oracle Clusterware:
5. Enable Oracle Clusterware and restart Oracle Clusterware on all nodes as root user:
# crsctl enable crs
# crsctl start crs
6.如果需要,移除舊接口:
6. Remove the old interface if required:
$ oifcfg delif -global <interfacename>[/<subnet>]
eg:
$ oifcfg delif -global eth0/192.168.0.0
C.適用于帶Flex ASM的12c和18c Oracle Clusterware
C. For 12c and 18c Oracle Clusterware with Flex ASM
請復習以上B部分,注意備注部分,備份如下:
Please review above section B and pay attention to the Note section, take a backup as follows:
在繼續之前,請在所有群集節點(diǎn)上備份profile.xml,已grid用戶(hù)執行:
Please take a backup of profile.xml on all cluster nodes before proceeding, as grid user:
$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
$ cp -p profile.xml profile.xml.bk
1.確保Oracle Clusterware正在群集中的所有群集節點(diǎn)上運行
1. Ensure Oracle Clusterware is running on ALL cluster nodes in the cluster
2. As grid user:
獲取現有信息。例如:
Get the existing information. For example:
$ oifcfg getif
<interfacename>1 100.17.10.0 global public
<interfacename>0 192.168.0.0 global cluster_interconnect,asm
上面的示例顯示網(wǎng)絡(luò )eth0用于cluster_interconnect和ASM網(wǎng)絡(luò )。
Above example shows network eth0 is used for both cluster_interconnect and ASM network.
添加新的cluster_interconnect信息:
Add the new cluster_interconnect information:
$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect[,asm]
For example:
A.添加具有相同子網(wǎng)的新接口bond0
a. add a new interface bond0 with the same subnet
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect,asm
B.添加具有相同接口名稱(chēng)但不同子網(wǎng)或新接口名稱(chēng)的新子網(wǎng)
b. add a new subnet with the same interface name but different subnet or new interface name
$ oifcfg setif -global eth0/192.68.10.0:cluster_interconnect,asm
or
$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect,asm
如果心跳網(wǎng)絡(luò )和ASM網(wǎng)絡(luò )使用不同的網(wǎng)絡(luò ),則相應地修改它們。
If different network is used for private network and ASM network, then modify them accordingly.
3.由于A(yíng)SMLISTENER正在使用心跳網(wǎng)絡(luò ),修改心跳網(wǎng)絡(luò )將影響ASMLISTENER。
3. As ASMLISTENER is using the private network, modifying the private network will affect ASMLISTENER.
需要使用新的網(wǎng)絡(luò )配置添加新的ASMLISTENER。
It is required to add a new ASMLISTENER with the new network configuration.
如果ASM網(wǎng)絡(luò )的子網(wǎng)未更改,請跳過(guò)此步驟。
Skip this step if the subnet for the ASM network is not changed.
3.1. 使用新子網(wǎng)添加新的ASMLISTENER(例如:ASMNEWLSNR_ASM),已grid用戶(hù)執行:
3.1. Add a new ASMLISTENER (for example: ASMNEWLSNR_ASM) with the new subnet, as grid user:
$ srvctl add listener -asmlistener -l <new ASM LISTENER NAME> -subnet <new subnet>
eg:
$ srvctl add listener -asmlistener -l ASMNEWLSNR_ASM -subnet 192.168.10.0
3.2. 刪除現有的ASMLISTENER(本例中為ASMLSNR_ASM)并刪除依賴(lài)項,已grid用戶(hù)執行:
3.2. Drop the existing ASMLISTENER (ASMLSNR_ASM in this example) and remove the dependency, as grid user:
$ srvctl update listener -listener ASMLSNR_ASM -asm -remove -force
$ lsnrctl stop ASMLSNR_ASM
注意-force選項是必需的,否則將發(fā)生以下錯誤:
Note. -force option is required, otherwise the following error will occur:
$ srvctl update listener -listener ASMLSNR_ASM -asm -remove
PRCR-1025 : Resource ora.ASMLSNR_ASM.lsnr is still running
$ srvctl stop listener -l ASMLSNR_ASM
PRCR-1065 : Failed to stop resource ora.ASMLSNR_ASM.lsnr
CRS-2529: Unable to act on 'ora.ASMLSNR_ASM.lsnr' because that would require stopping or relocating 'ora.asm', but the force option was not specified
3.3 驗證配置
3.3 Verify the configuration
$ srvctl config listener -asmlistener
$ srvctl config asm
4.所有節點(diǎn)停止Oracle Clusterware并禁用自動(dòng)啟動(dòng),已root用戶(hù)執行:
4. Shutdown Oracle Clusterware on ALL nodes and disable the Oracle Clusterware as root user:
# crsctl stop crs
# crsctl disable crs
5.根據需要在操作系統級別更改網(wǎng)絡(luò )配置,確保更改后所有節點(diǎn)都可以使用新接口。
5. Make the network configuration change at OS level as required, ensure the new interface is available on all nodes after the change.
$ ifconfig -a
$ ping <private hostname>
4.所有節點(diǎn)停止Oracle Clusterware并啟用自動(dòng)啟動(dòng)并重啟Clusterware,已root用戶(hù)執行:
6. Enable Oracle Clusterware and restart Oracle Clusterware on all nodes as root user:
# crsctl enable crs
# crsctl start crs
7.如果需要,刪除舊的網(wǎng)絡(luò )接口。
7. Remove the old interface if required:
$ oifcfg delif -global <interfacename>[/<subnet>]
eg:
$ oifcfg delif -global <interfacename>0/192.168.0.0
11gR2+需要注意的:
Something to note for 11gR2+
1.如果基礎網(wǎng)絡(luò )配置已更改,但尚未運行oifcfg進(jìn)行相同的更改,則在Oracle Clusterware重新啟動(dòng)時(shí),CRSD將無(wú)法啟動(dòng)。
1. If underlying network configuration has been changed, but oifcfg has not been run to make the same change, then upon Oracle Clusterware restart, the CRSD will not be able to start.
crsd.log日志顯示如下:
The crsd.log will show:
2010-01-30 09:22:47.234: [ default][2926461424] CRS Daemon Starting
..
2010-01-30 09:22:47.273: [ GPnP][2926461424]clsgpnp_Init: [at clsgpnp0.c:837] GPnP client pid=7153, tl=3, f=0
2010-01-30 09:22:47.282: [ OCRAPI][2926461424]clsu_get_private_ip_addresses: no ip addresses found.
2010-01-30 09:22:47.282: [GIPCXCPT][2926461424] gipcShutdownF: skipping shutdown, count 2, from [ clsinet.c : 1732], ret gipcretSuccess (0)
2010-01-30 09:22:47.283: [GIPCXCPT][2926461424] gipcShutdownF: skipping shutdown, count 1, from [ clsgpnp0.c : 1021], ret gipcretSuccess (0)
[ OCRAPI][2926461424]a_init_clsss: failed to call clsu_get_private_ip_addr (7)
2010-01-30 09:22:47.285: [ OCRAPI][2926461424]a_init:13!: Clusterware init unsuccessful : [44]
2010-01-30 09:22:47.285: [ CRSOCR][2926461424] OCR context init failure. Error: PROC-44: Error in network address and interface operations Network address and interface operations error [7]
2010-01-30 09:22:47.285: [ CRSD][2926461424][PANIC] CRSD exiting: Could not init OCR, code: 44
2010-01-30 09:22:47.285: [ CRSD][2926461424] Done.
上述錯誤表明操作系統設置(oifcfg iflist)和gpnp profile setting profile.xml之間不匹配。
Above errors indicate a mismatch between OS setting (oifcfg iflist) and gpnp profile setting profile.xml.
解決方法:將操作系統網(wǎng)絡(luò )配置恢復到原始狀態(tài),啟動(dòng)Oracle Clusterware。然后按照上述步驟再次進(jìn)行更改。
Workaround: restore the OS network configuration back to the original status, start Oracle Clusterware. Then follow above steps to make the changes again.
如果基礎網(wǎng)絡(luò )尚未更改,但oifcfg setif使用錯誤的子網(wǎng)地址或接口名稱(chēng)運行,則會(huì )發(fā)生相同的問(wèn)題。
If the underlying network has not been changed, but oifcfg setif has been run with a wrong subnet address or interface name, same issue will happen.
2.如果集群中的任何一個(gè)節點(diǎn)停機,oifcfg命令將失敗并出現錯誤:
2. If any one node is down in the cluster, oifcfg command will fail with error:
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
PRIF-26: Error in update the profiles in the cluster
解決方法:在Oracle Clusterware未運行的節點(diǎn)上啟動(dòng)Oracle Clusterware。確保所有群集節點(diǎn)上的Oracle Clusterware都已啟動(dòng)。
Workaround: start Oracle Clusterware on the node where it is not running. Ensure Oracle Clusterware is up on all cluster nodes.
如果節點(diǎn)因任何操作系統原因關(guān)閉,請在執行專(zhuān)用網(wǎng)絡(luò )更改之前從群集中刪除該節點(diǎn)。
If the node is down for any OS reason, please remove the node from the cluster before performing private network change.
3.如果 Grid Infrastructure所有者以外的用戶(hù)發(fā)出上述命令,它將失敗,并出現相同的錯誤:
3. If a user other than Grid Infrastructure owner issues above command, it will fail with same error:
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
PRIF-26: Error in update the profiles in the cluster
Workaround: ensure to login as Grid Infrastructure owner to perform such command.
4.從11.2.0.2開(kāi)始,如果嘗試刪除最后一個(gè)專(zhuān)用接口(群集_互連),而不首先添加新接口,則會(huì )發(fā)生以下錯誤:
4. From 11.2.0.2 onwards, if attempt to delete the last private interface (cluster_interconnect) without adding a new one first, following error will occur:
PRIF-31: Failed to delete the specified network interface because it is the last private interface
解決方法:在刪除舊的私有接口之前,先添加新的私有接口。
Workaround: Add new private interface first before deleting the old private interface.
5.如果節點(diǎn)上的Oracle Clusterware已關(guān)閉,則可能會(huì )出現以下錯誤:
5. If Oracle Clusterware is down on the node, the following error is expected:
$ oifcfg getif
PRIF-10: failed to initialize the cluster registry
解決方法:在節點(diǎn)上啟動(dòng)Oracle Clusterware
Workaround: Start the Oracle Clusterware on the node
Windows系統的注意事項
Notes for Windows Systems
在Windows/RAC集群上更改接口的語(yǔ)法與在Unix/Linux上相同,但接口名稱(chēng)略有不同。在Windows系統上,分配給接口的默認名稱(chēng)通常命名為:
The syntax for changing the interfaces on Windows/RAC clusters is the same as on Unix/Linux, but the interface names will be slightly different. On Windows systems, the default names assigned to the interfaces are generally named such as:
Local Area Connection
Local Area Connection 1
Local Area Connection 2
如果使用的接口名稱(chēng)中有空格,則該名稱(chēng)必須用引號括起來(lái)。
If using an interface name that has space in it, the name must be enclosed in quotes.
另外,請注意它是區分大小寫(xiě)的。例如,在Windows上,要設置cluster_interconnect:
Also, be aware that it is case sensitive. For example, on Windows, to set cluster_interconnect:
C:\oracle\product\10.2.0\crs\bin\oifcfg setif -global "Local Area Connection 1"/192.168.1.0:cluster_interconnect
但是,Windows上的最佳做法是將接口重命名為更有意義的接口,例如將其重命名為"ocwpublic"和"ocwprivate"。
However, it is best practice on Windows to rename the interfaces to be more meaningful, such as renaming them to 'ocwpublic' and 'ocwprivate'.
如果在安裝Oracle Clusterware后重命名接口名稱(chēng),則需要運行"oifcfg"來(lái)添加新接口并刪除舊接口,如上所述。
If interface names are renamed after Oracle Clusterware is installed, then you will need to run 'oifcfg' to add the new interface and delete the old one, as described above.
通過(guò)運行以下命令,可以查看每個(gè)節點(diǎn)上可用的接口名稱(chēng):
You can view the available interface names on each node by running the command:
oifcfg iflist -p -n
必須在每個(gè)節點(diǎn)上運行此命令,以驗證定義的接口名稱(chēng)是否相同。
This command must be run on each node to verify the interface names are defined the same.
使用oifcfg更改接口名稱(chēng)的后果
Ramifications of Changing Interface Names Using oifcfg
對于心跳接口,數據庫將使用存儲在OCR中的接口,該接口被定義為緩存融合通信的'cluster_interconnect'。
For the Private interface, the database will use the interface stored in the OCR and defined as a 'cluster_interconnect' for cache fusion traffic.
cluster_interconnect信息在啟動(dòng)時(shí)可在警報日志中的參數列表之后獲得,例如:
The cluster_interconnect information is available at startup in the alert log, after the parameter listing - for example:
For pre 11.2.0.2:
Cluster communication is configured to use the following interface(s) for this instance
192.XXX.X.1
For 11.2.0.2+: (HAIP address will show in alert log instead of private IP)
Cluster communication is configured to use the following interface(s) for this instance
169.XXX.XX.97
如果這是不正確的,則需要在更正OCR條目后重新啟動(dòng)實(shí)例。
If this is incorrect, then instance is required to restart once the OCR entry is corrected.
這同樣適用于A(yíng)SM實(shí)例和數據庫實(shí)例。在Windows系統上,關(guān)閉實(shí)例后,在重新讀取OCR之前,還需要停止/重新啟動(dòng)OracleService<SID>(或OracleSMService<ASMSID>)。
This applies to ASM instances and Database instances alike. On Windows systems, after shutting down the instance, it is also required to stop/restart the OracleService<SID> (or OracleASMService<ASMSID> before the OCR will be re-read.
Oifcfg Usage
要查看oifcfg的完整選項,只需執行:
To see the full options of oifcfg, simply type:
$ <CRS_HOME>/bin/oifcfg
場(chǎng)景五:使用HAIP為11gR2及以上版本添加或刪除cluster_interconnect
Case V. Add or remove cluster_interconnect for 11gR2 and above with HAIP
1.grid執行,使用HAIP將另一個(gè)專(zhuān)用網(wǎng)絡(luò )添加到現有集群中:
1. To add another private network into existing cluster using HAIP, as grid user:
$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect
For example:
$ oifcfg setif -global <interfacename>/192.XXX.XX.0:cluster_interconnect
關(guān)閉所有節點(diǎn)上的CRS,然后重新啟動(dòng)所有節點(diǎn)上的CRS,以便HAIP拾取新接口。
Shutdown CRS on ALL nodes, then restart CRS on ALL nodes for HAIP to pick up the new interface.
不能以滾動(dòng)方式重新啟動(dòng)CRS。
It is insufficient to restart CRS in rolling manner.
2.要以grid用戶(hù)身份使用HAIP從集群中刪除心跳網(wǎng)絡(luò ),請執行以下操作:
2. To remove a private network from a cluster with HAIP, as grid user:
$ oifcfg delif -global <interfacename>
For example:
$ oifcfg delif -global <interfacename>
HAIP將故障切換到剩余接口,并且clusterware/database在刪除接口后繼續運行。
HAIP will failover to the remaining interface and clusterware/database continue to function after the interface removal.
要刪除額外的HAIP接口,需要關(guān)閉所有節點(diǎn)上的CRS,然后重新啟動(dòng)所有節點(diǎn)上的CRS。
To remove the extra HAIP interface, it is required to shutdown CRS on ALL nodes, then restart CRS on ALL nodes.
不能以滾動(dòng)方式重新啟動(dòng)CRS。
It is insufficient to restart CRS in rolling manner.
##########################################
How to Modify SCAN Setting or SCAN Listener Port after Installation (文檔 ID 972500.1)
目標:
GOAL
本說(shuō)明提供了更新11gR2 Grid Infrastructure(CRS)Single Client Access(SCAN)設置或SCAN listener port設置的步驟,如果設置不正確或在設置后更改了該設置。
This note provides steps to update 11gR2 Grid Infrastructure (CRS) Single Client Access Name (SCAN) setting or SCAN listener port setting if it's not setup properly or if it's changed after setup.
注意:
Note:
1.使用GNS時(shí),本程序不適用
1. This procedure does not apply when GNS is being used
2.即使在"typical"安裝期間將clustername和SCAN名稱(chēng)設置為相同,更改SCAN名稱(chēng)也不會(huì )影響clustername,因為更改clustername需要取消配置并重新配置整個(gè)群集。
2. Even though clustername and SCAN name is set to the same during 'typical' installation, changing SCAN name will not affect clustername as change of clustername requires deconfigure and reconfigure of the entire cluster.
解決方案
SOLUTION
A.更新SCAN設置
A. To update SCAN setting
1.根據文檔“Oracle Grid Infrastructure Installation Guide”,Oracle強烈建議在DNS或GNS As/etc/hosts文件中配置SCAN名稱(chēng),該文件只能解析為一個(gè)IP地址。
1. As per documentation "Oracle Grid Infrastructure Installation Guide", Oracle strongly recommend to configure SCAN name in either DNS or GNS as /etc/hosts file can only resolve to one IP address.
SCAN IP必須與public和VIP位于同一子網(wǎng)中。如果新的scan IP將位于不同的子網(wǎng)中,請參閱注釋276434.1以首先更改nodeapps/網(wǎng)絡(luò )資源。
SCAN IP must be in same subnet as public and VIP. If the new SCAN IP will be in different subnet, refer to note 276434.1 to change nodeapps/network resource first.
1a.如果打算使用/etc/hosts進(jìn)行SCAN名稱(chēng)解析,則所有節點(diǎn)上必須存在相同且唯一的掃描名稱(chēng)條目。
1a. If you intend to use /etc/hosts for SCAN name resolution, the same and only entry for SCAN name must exist on all nodes.
1b. 如果要使用DNS進(jìn)行scan名稱(chēng)解析,請從所有節點(diǎn)上的/etc/hosts中刪除掃描名稱(chēng)條目,并確保nslookup在所有節點(diǎn)上返回良好結果,例如:
1b. If you intend to use DNS for SCAN name resolution, remove entries for SCAN name from /etc/hosts on all nodes, and make sure nslookup returns good result on all nodes, for example:
$ nslookup <scan>.oracle.com
..
Name: <scan>.oracle.com
Address: 10.x.x.201
Name: <scan>.oracle.com
Address: 10.x.x.202
Name: <scan>.oracle.com
Address: 10.x.x.203
2.正確配置#1a或#1b后,執行以下操作進(jìn)行修改:
2. Once #1a or #1b is configured properly, execute the following to modify:
如果要將scan名稱(chēng)解析從本地主機文件切換到DNS,請確保在執行以下命令之前刪除所有節點(diǎn)上本地主機文件中的掃描名稱(chēng)。
If name resolution for SCAN is being switched from local hosts file to DNS, be sure to remove SCAN name in local hosts file on all nodes prior to execute below commands.
2.1 修改SCAN名字或SCAN VIP地址
2.1. To modify SCAN name or SCAN VIP addresses:
2.1.1 grid用戶(hù)停止資源
2.1.1. As grid user stop resources:
$ $GRID_HOME/bin/srvctl stop scan_listener
$ $GRID_HOME/bin/srvctl stop scan
2.1.2 root用戶(hù)修改SAN:
2.1.2. As root user modify SCAN:
# $GRID_HOME/bin/srvctl modify scan -n <scan>.oracle.com
###僅適用于11.2.0.1,如果由于bug 9603829,您打算更改SCAN名稱(chēng),請執行以下操作:
### For 11.2.0.1 only, if you intend to change SCAN name, due to bug 9603829, execute the following:
# $GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=<new SCAN name>"
### Example:
# $GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=<scan>.oracle.com"
更改SCAN名稱(chēng)后,將數據庫init.ora/spfile參數remote_listener更新為新名稱(chēng)。
Once SCAN name is changed, update database init.ora/spfile parameter remote_listener to the new one.
2.1.3 grid用戶(hù)修改和啟動(dòng)資源:
2.1.3. As grid user modify and start resources:
$ $GRID_HOME/bin/srvctl modify scan_listener -u
$ $GRID_HOME/bin/srvctl start scan_listener
2.1.4 確認更改
2.1.4. To confirm the change
$ $GRID_HOME/bin/srvctl config scan
SCAN name: <scan>.oracle.com, Network: 1/10.x.x.0/255.255.255.0/eth1
SCAN VIP name: scan1, IP: /10.x.x.201/120.x.x.201
SCAN VIP name: scan2, IP: /10.x.x.202/120.x.x.202
SCAN VIP name: scan3, IP: /10.x.x.203/120.x.x.203
$ $GRID_HOME/bin/srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
2.2. 要將SCAN更改為在第二個(gè)網(wǎng)絡(luò )上,請執行以下操作:
2.2. To change SCAN to be on second network:
默認情況下,SCAN將在第一個(gè)公共網(wǎng)絡(luò )(ora.net1.network)上配置,但在多個(gè)公共網(wǎng)絡(luò )環(huán)境中,SCAN可以在第二個(gè)或其他網(wǎng)絡(luò )上運行。
By default, SCAN will be configured on first public network (ora.net1.network), however in multiple public network environment, SCAN can run on second or other network.
沒(méi)有修改SCAN以使用非第一個(gè)網(wǎng)絡(luò )、更改為第二個(gè)或其他網(wǎng)絡(luò )、scan_listener和scan資源的選項,需要刪除并重新添加。
There's no option to modify SCAN to use non-first network, to change to second or other network, scan_listener and scan resources need to be removed and added back.
在本例中,我們將SCAN從net1移動(dòng)到net2
In this example, we'll move SCAN from net1 to net2
$ $GRID_HOME/bin/srvctl config network
Network exists: 1/10.x.x.0/255.255.255.128/eth3, type static
Network exists: 2/10.x.x.0/255.255.255.128/eth4, type static
您還可以在第二個(gè)網(wǎng)絡(luò )中修改scan,如下面12.2所示
You can also modify the scan in the second network like below on 12.2
srvctl modify scan_listener -netnum 2 -update -invitednodes "node1,node2"
2.2.21 grid用戶(hù)停止資源和移除scan_listener:
2.2.1. As grid user stop resources and remove scan_listener:
$ $GRID_HOME/bin/srvctl stop scan_listener $GRID_HOME/bin/srvctl stop scan
$ $GRID_HOME/bin/srvctl remove scan_listener -f
2.2.2 root用戶(hù)移除和添加SCAN
2.2.2. As root user remove and add SCAN:
# $GRID_HOME/bin/srvctl remove scan -f
#$GRID_HOME/bin/srvctl add scan -n <scan-name> -k 2
更改SCAN名稱(chēng)后,將數據庫init.ora/spfile參數remote_listener更新為新名稱(chēng)。
Once SCAN name is changed, update database init.ora/spfile parameter remote_listener to the new one.
2.2.3 grid用戶(hù)添加scan_listener 和 start resources:
2.2.3. As grid user add scan_listener and start resources:
$ $GRID_HOME/bin/srvctl add scan_listener-p <port>
$ $GRID_HOME/bin/srvctl start scan_listener
B.修改SCAN監聽(tīng)端口
B. To modify SCAN listener port
grid用戶(hù)執行:
As grid user:
1.修改SCAN監聽(tīng)端口
1. Modify SCAN listener port:
$GRID_HOME/bin/srvctl modify scan_listener -p <new-SCAN-port>
更新11gR2數據庫init.ora參數:alter system set remote_listener='<SCAN-name>:<new-port-number>' scope=both;
Update 11gR2 database init.ora parameter: alter system set remote_listener='<SCAN-name>:<new-port-number>' scope=both;
2.重啟SCAN listener,使得新端口生效
2. Restart SCAN listener so the new port will be effective:
$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl start scan_listener
3.確認更改
3. Confirm the change:
$GRID_HOME/bin/srvctl config scan_listener
##########################
How to Update the IP Address of the SCAN VIP Resources (ora.scan{n}.vip) (文檔 ID 952903.1)
目標:
GOAL
本文檔旨在解釋如何更改11gR2 Grid Infrastructure/CRS及更高版本環(huán)境中與SCAN VIP相關(guān)的IP地址。
The purpose of this document is to explain how to change the IP addresses associated with the SCAN VIPs in 11gR2 Grid Infrastructure / CRS and higher environments.
與SCAN VIP資源關(guān)聯(lián)的IP地址最初是在創(chuàng )建SCAN資源時(shí)設置的。
The IP addresses associated with the SCAN VIP resources are initially set when the SCAN resources are created.
對SCAN DNS條目的任何更改都不會(huì )自動(dòng)傳播到clusterware,需要手動(dòng)完成。
Any changes to the DNS entry for the SCAN are not automatically propagated to the clusterware and need to be done manually.
這僅適用于不使用GNS的安裝。
This applies only to installations that are not using GNS.
本說(shuō)明中的信息在SCAN最初僅配置一個(gè)地址,現在擴展為容納三個(gè)IP地址的情況下也很有用。
The information in this note can also be helpful in cases where SCAN was originally configured with just one address and is now being expanded to accommodate three IP addresses.
解決方案:
SOLUTION
在更改SCAN VIP之前,需要使用新的IP地址更新域名服務(wù)器(DNS)上的scan name條目。這通常由網(wǎng)絡(luò )管理員完成。要檢查當前設置,可以使用以下命令:
Before the SCAN VIPs can be changed, the entry for the SCAN name on the Domain Name Server (DNS) needs to be updated with the new IP addresses. This usually will be done by a network administrator. To check the current setting, the following command can be used:
nslookup <scan_name>
要檢查SCAN VIP的當前IP地址,請以root用戶(hù)身份運行以下命令:
To check the current IP address(es) of the SCAN VIPs, run the following commands as the root user:
$GRID_HOME/bin/srvctl config scan
停止SCAN listeners和SCAN
Stop the SCAN listeners and SCAN
$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl stop scan
接下來(lái)使用DNS條目中的新IP地址刷新SCAN VIP:
Next refresh the SCAN VIPs with the new IP addresses from the DNS entry:
$GRID_HOME/bin/srvctl modify scan -n <scan_name
要檢查SCAN VIP是否已更改,請運行以下命令,它現在應顯示新的IP地址。
To check if the SCAN VIPs have been changed, run the following command, it should now show the new IP addresses.
$GRID_HOME/bin/srvctl config scan
Restart SCAN & SCAN listener:
$GRID_HOME/bin/srvctl start scan
$GRID_HOME/bin/srvctl start scan_listener
如果SCAN VIPs的數量已更改,則需要更新SCAN listener:
If the number of SCAN VIPs has changed, the SCAN listener needs to be updated:
$GRID_HOME/bin/srvctl modify scan_listener -u
下面是使用以下配置的示例:
Below is an example using the following configuration:
SCAN的名稱(chēng)為sales-SCAN.example.com
The name of the SCAN is sales-scan.example.com
公網(wǎng)子網(wǎng)為10.XXX.XXX.0
subnet of the public network is 10.XXX.XXX.0
公網(wǎng)子網(wǎng)掩碼為255.XXX.XXX.0
netmask for the public network is 255.XXX.XXX.0
public接口名稱(chēng)為eth1
name of the public interface is eth1
old IP addresses: 10.XXX.XXX.81, 10.XXX.XXX.82 & 10.XXX.XXX.83
new IP addresses: 10.XXX.XXX.121, 10.XXX.XXX.122 & 10.XXX.XXX.123
停止和啟動(dòng)SCAN VIPs/listeners可以由網(wǎng)格用戶(hù)完成,但是“srvctl modify SCAN”命令必須由root用戶(hù)執行,因此作為root用戶(hù)執行所有步驟是可行的。
Stopping & starting the SCAN VIPs/listeners can be done by the grid user, however the 'srvctl modify scan' command must be executed by root user, so it's practical to execute all steps as the root user.
DNS服務(wù)器上的SCAN查找顯示條目已使用新IP地址更新:
A lookup of the SCAN on the DNS server shows that the entry has already been updated with the new IP addresses:
$ nslookup sales-scan.example.com
Server: dns1.example.com
Address: 10.XXX.XXX.70#53
Name: sales-scan.example.com
Address: 10.XXX.XXX.123
Name: sales-scan.example.com
Address: 10.XXX.XXX.122
Name: sales-scan.example.com
Address: 10.XXX.XXX.121
停止SCAN listener 和 the SCAN VIP 資源:
Stop the SCAN listener and the SCAN VIP resources:
# $GRID_HOME/bin/srvctl stop scan_listener
# $GRID_HOME/bin/srvctl stop scan
# $GRID_HOME/bin/srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
SCAN VIP scan2 is enabled
SCAN VIP scan2 is not running
SCAN VIP scan3 is enabled
SCAN VIP scan3 is not running
# $GRID_HOME/bin/srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is not running
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is not running
SCAN VIP resources仍然顯示舊的地址
The SCAN VIP resources still show the old IP addresses:
# $GRID_HOME/bin/srvctl config scan
SCAN name: sales-scan, Network: 1/10.XXX.XXX.0/255.XXX.XXX.0/eth1
SCAN VIP name: scan1, IP: /sales-scan.example.com/10.XXX.XXX.81
SCAN VIP name: scan2, IP: /sales-scan.example.com/10.XXX.XXX.82
SCAN VIP name: scan3, IP: /sales-scan.example.com/10.XXX.XXX.83
現在通知CRS更新SCAN VIP resources
Now tell CRS to update the SCAN VIP resources:
# $GRID_HOME/bin/srvctl modify scan -n sales-scan.example.com
驗證更改已成功,再次檢查SCAN配置:
To verify that the change was successful, check the SCAN configuration again:
# $GRID_HOME/bin/srvctl config scan
SCAN name: sales-scan, Network: 1/10.XXX.XXX.0/255.XXX.XXX.0/eth1
SCAN VIP name: scan1, IP: /sales-scan.example.com/10.XXX.XXX.121
SCAN VIP name: scan2, IP: /sales-scan.example.com/10.XXX.XXX.122
SCAN VIP name: scan3, IP: /sales-scan.example.com/10.XXX.XXX.123
啟動(dòng)SCAN和SCAN監聽(tīng):
Start SCAN and the SCAN listener:
# $GRID_HOME/bin/srvctl start scan
# $GRID_HOME/bin/srvctl start scan_listener
#####chenjuchao 2021-08-21 15:00#####
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
最新資訊
相關(guān)推薦
相關(guān)標簽
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站