如何在 oracle 叢集環境下修改私網資訊 (文件 ID 2103317.1)

mosdoc發表於2016-12-14

如何在 oracle 叢集環境下修改私網資訊 (文件 ID 2103317.1)




文件內容

目標
解決方案
  例1: 更改私有主機名
  例2:只更改私有 ip 地址不更改網路卡、子網及子網掩碼資訊
  例3:只改變私有網路的 MTU 值
  例4:更改私有網路卡名字,子網及掩碼
  A. 對於 11gR2 以前的叢集管理軟體
  B. 對於 11gR2 和 12c 上沒有使用 flex ASM 的版本
  C. 對於 12C flex ASM 結構
  關於 11gR2 的一些注意事項
  關於 Windows 系統注意事項
  使用 oifcfg 命令更改網路卡名字的影響
  Oifcfg 命令用法
  例5 對於 11gR2 或以上版本的 HAIP 新增或刪除叢集私網
參考


適用於:

Oracle Database - Enterprise Edition - 版本 10.1.0.2 到 12.2.0.1 [發行版 10.1 到 12.2]
本文件所含資訊適用於所有平臺

目標

本文的目的是描述如何在 oracle 叢集環境中更改或更新私有網路(cluster_interconnect)資訊。

有時我們需要更改或更新網路卡的名字,或者更改網路卡的子網掩碼,再或者更改當時原始安裝時就輸入了不正確的資訊,也許還有其它的原因,oifcfg 工具當時沒有成功的安裝。

請參考文件:Note 276434.1 for modifying public network and VIP associated information
和文件: Note 1386709.1 for basics of IPv4 subnet and Oracle Clusterware。

提示:對於 oracle Engineered system(Exadata)和 oracle Applicance(ODA)不適用本文件。

 

解決方案

Oracle 叢集中的網路資訊(介面,子網及每個網路卡的角色)都可以被’oifcfg’ 命令管理, 但是沒有網路卡的IP地址除外,oifcfg 命令不能修改IP地址資訊. ‘oifcfg getif’ 命令可以用來顯示OCR中當前網路卡的配置資訊:

% $CRS_HOME/bin/oifcfg getif 
eth0 10.2.156.0 global public 
eth1 192.168.0.0 global cluster_interconnect

在 Unix/Linux 系統中,網路卡名字是被系統自動分配的,依據系統平臺的不同而不同。對於 windows 系統,請參考下面的附帶的文件. 上面的例子顯示當前網路卡 eth0 被用作公網並且子網為 10.2.156.0 eth1 被用作叢集私網,子網為192.168.0.0。

‘公有’ 網路是伺服器與客戶端之間的通訊(與 VIP 使用相同的網段並以不同的記錄儲存在 OCR 中),與之對應的’cluster_interconnect’網路是用來在 RDBMS/ASM 節點間快取融合。從 11gR2 開始,cluster_interconnect 同時被用作叢集間的心跳,相對於 11gR2 以前的版本,當配置叢集心跳資訊時指定主機名而言,這是一個標誌性的改變。

如果私有網路卡的子網或介面名字配置不正確,我們需要使用 crs/grid 使用者來更改。

例1: 更改私有主機名

在 11.2 oracle clusterware 之前的版本,私有主機名被記錄在 OCR 中, 它不能被更改,一般情況下私有主機名是不需要改變的,它附屬的 ip 可以被更改,只有使用刪除/新增節點或重新安裝 oracle clusterware 來更改私有主機名。

在 11.2 Grid 結構中,私有主機名不在記錄在 OCR 中,並且不存在依賴關係,所以它可以在 /etc/hosts 檔案中任意更改。

例2:只更改私有 ip 地址不更改網路卡、子網及子網掩碼資訊

舉例,私有 ip 地址從 192.168.1.10 更改至 192.168.1.21,網路卡名字及子網保持不變。或者只改變MAC地址,保持private IP address/interface name/subnet/network不變

只要關閉需要更改主機上的 oracle clusterware 軟體,在作業系統層,根據需求更改私有 ip 地址或者MAC地址(如:/etc/hosts,OS network config 等等), 再重啟啟動 oracle clusterware 軟體即可。

例3:只改變私有網路的 MTU 值

舉例, 將私有網路 MTU 值從1500更改至9000(啟用 jumbo frame),網路卡名字保持不變。

1. 關閉叢集中的所有節點。
2. 在作業系統層更改 MTU 需要設定的值,確保更改後 MTU 值的私有網路卡可用並且可以 ping 通叢集中的所有節點。
3. 重啟所有節點的叢集管理軟體。

例4:更改私有網路卡名字,子網及掩碼

提示:當子網掩碼被更改,但是子網標識沒有改變時,如:
子網掩碼從 255.255.0.0 更改至 255.255.255.0,私網 ip 為 192.168.0.x,子網標識保持不變 192.168.0.0,網路卡名字沒有改變.關閉所有需要更改的主機 oracle clusterware,在作業系統層修改私有網路IP地址(如:作業系統 網路配置等等)。並重啟叢集中所有節點,請注意,這種更改是不能採用輪轉方式(rolling manaer)完成的。

當子網掩碼被改變,附屬的子網標識也經常會被改變,oracle 在 OCR 中只儲存網路卡名字及子網標識的資訊,而不儲存子網掩碼。可以使用 oifcfg 命令完成這樣的變更,oifcfg 命令只需在叢集中的一個節點執行,而不是所有節點。

A. 對於 11gR2 以前的叢集管理軟體

1. 使用 oifcfg 命令新增新的私有網路資訊,刪除舊的私有網路資訊:

% $ORA_CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:cluster_interconnect
% $ORA_CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>]]

舉例:
% $ORA_CRS_HOME/bin/oifcfg setif -global eth3/192.168.2.0:cluster_interconnect
% $ORA_CRS_HOME/bin/oifcfg delif -global eth1/192.168.1.0

校驗結果
% $ORA_CRS_HOME/bin/oifcfg getif   
eth0 10.2.166.0 global public 
eth3 192.168.2.0 global cluster_interconnect

2. 關閉 Oracle Clusterware

使用 root 使用者執行: # crsctl stop crs

3. 在作業系統層面更改網路配置,修改叢集內所有節點的 /etc/hosts 檔案,確保叢集內所有節點新的網路設定都已生效:

% ping <private hostname/IP>
% ifconfig -a  on Unix/Linux 

% ipconfig /all on windows

4. 重新啟動 Oracle Clusterware

以 root 使用者:# crsctl start crs

提示:如果在 linux 系統上正在執行 OCFS2,則可能還需要更改 OCFS2 執行在其它節點的私有 ip 地址. 更多詳細的資訊,請參考: Note 604958.1

 

B. 對於 11gR2 和 12c 上沒有使用 flex ASM 的版本

針對於 11.2 的結構,私有網路配置資訊不但儲存在 OCR 中,而且還儲存在 gpnp 屬性檔案中。如果私有網路不可用或定義錯誤,則 CRSD 程式將無法啟動,任何隨後對於 OCR 的改變都是不可能完成的,因此需要注意當對私有網路的配置資訊進行修改,正確的改變順序是非常重要的。同時請注意,手動修改 gpnp 屬性檔案是不支援的。

在對叢集中所有節點操作之前,請先備份 profile.xml 配置檔案。作為 grid 使用者執行:
$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
$ cp -p profile.xml profile.xml.bk


1. 確保叢集中的所有節點都已啟動並正常執行

2. 使用 grid 使用者:

獲取下面資訊, 例如:

$ oifcfg getif
eth1 100.17.10.0 global public
eth0 192.168.0.0 global cluster_interconnect


加入新的叢集私網通訊資訊:

$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect

例如:
a. 加入新的並有相同子網的介面卡 bond0
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect

b. add a new subnet with the same interface name but different subnet or new interface name
$ 新增一個新的子網具有相同網路卡的名稱但不同的子網或新的網路卡名

$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect

 

1. 如果網路卡不可用,需要使用 –global 選項來完成,而不能使用 –node 選項,它將導致節點被驅逐。

2. 如果網路卡在伺服器上可用,則可以使用下面命令識別子網地址:
$ oifcfg iflist

它列出了網路卡及子網地址,即使 oracle 叢集沒有啟動,此命令也可以被執行。請注意,子網掩碼有可能不是 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        << 這是一個私有網路子網地址附屬的私有網路 ip 地址為 10.2.3.86

3. 如果需要新增第二個私有網路,而不是替換現有的私有網路,則需要保證兩個網路卡的 MTU 值相同,否則例項將無法啟動並報如下錯誤資訊:
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 或更高版本, 不建議在 ASM 或 database 的 spfile 或 pfile 中設定 cluster interconnects 引數。無論什麼原因如果設定了該引數,則需要在叢集關閉之前需將新的私網 ip 地址設定在 spfile 或 pfile 中,否則它會由於私網資訊不匹配而導致重啟失敗。


校驗更改後的值:

$ oifcfg getif


3. 使用 root 使用者關閉叢集中所有的節點並禁用叢集:

# crsctl stop crs
# crsctl disable crs


4. 使網路配置資訊都已在 OS 層更改完成,確保更改完成後新的介面在所有的節點都可用有效:

$ ifconfig -a
$ ping <private hostname>


5. 使用 root 使用者啟用 oracle 叢集並重新啟動叢集中的所有節點:

# crsctl enable crs
# crsctl start crs


6. 如果需要去除舊介面卡資訊:

$ oifcfg delif -global <if_name>[/<subnet>]
例如:
$ oifcfg delif -global eth0/192.168.0.0

 

C. 對於 12C flex ASM 結構

請檢查上面部分B,並關注提示部分,按下面命令做備份:

在對叢集中所有節點操作之前,請先備份 profile.xml 配置檔案。 作為 grid 使用者執行:
$ cd $GRID_HOME/gpnp/<hostname>/profiles/peer/
$ cp -p profile.xml profile.xml.bk

1. 確保 oracle 叢集中的所有節點都已正常執行。

2. 使用 grid 使用者:

得到現有資訊,如下:

$ oifcfg getif
eth1 100.17.10.0 global public
eth0 192.168.0.0 global cluster_interconnect,asm

上面例子顯示網路卡 ech0 被用作叢集私網和 ASM 網路。

加入新的叢集私網資訊:

$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect[,asm]

如:
a. 加入一個新的具有相同子網網路卡 bond0
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect,asm

b. 加入一個新的並具有相同網路卡名字的子網,或不同子網和具有新的介面名字
$ oifcfg setif -global eth0/192.68.10.0:cluster_interconnect,asm

$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect,asm

 如果有不同的網路用於私有網路和 ASM 網路,則可以對其進行相應的調整。

3. 當 ASMLISTENER 正被用作私有網路,如果對其修改則會影響 ASMLISTENER。需要新增一個新的 ASMLISTENER 及新的網路配置。如果 ASM 的子網網路沒有改變則跳過這一步。

3.1. 加入一個新的 ASMLISTENE(例:ASMNEWLISNR_ASM)及新的子網,使用 grid 使用者:

$ srvctl add  listener -asmlistener -l <new ASM LISTENER NAME> -subnet <new subnet>

如:
$ srvctl add listener -asmlistener -l ASMNEWLSNR_ASM -subnet 192.168.10.0

3.2. 刪除現有的 ASMLISTENER(這個例子中 ASMLSNR_ASM)並去除依賴關係,使用 grid 使用者:

$ srvctl update listener -listener ASMLSNR_ASM -asm -remove -force
$ lsnrctl stop ASMLSNR_ASM

 

注意. 需要使用 –force 選項,否則會出現下面錯誤:

$ 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. 使用 root 使用者關閉叢集中的所有節點並禁用叢集:

# crsctl stop crs
# crsctl disable crs

5. 在作業系統層面更改網路配置,更改之後,確保所有節點上的新網路卡生效:

$ ifconfig -a
$ ping <private hostname>

6. 使用 root 使用者啟用 oracle 叢集並重新啟動叢集中的所有節點:

# crsctl enable crs
# crsctl start crs

7. 刪除舊的網路卡資訊:

$ oifcfg delif -global <if_name>[/<subnet>]
如:
$ oifcfg delif -global eth0/192.168.0.0

 

 

關於 11gR2 的一些注意事項


1. 如果底層網路配置已經更改, 但是 oifcfg 尚未執行同樣的變更,則重啟 oracle 叢集會導致 crsd 程式不能啟動。

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.xml 配置檔案設定不匹配。

解決方法:恢復作業系統網路配置到最初的狀態,啟動 oracle 叢集,然後再按照上面的步驟重新更改。

如果底層的網路並沒有改變,但 oifcfg 已經被設定了一個錯誤的子網地址或介面名字,則會發生同樣的問題。

2. 如果叢集中的任何一個節點關閉,oifcfg 命令將會失敗並顯示錯誤:

$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
PRIF-26: Error in update the profiles in the cluster

解決方案:啟動 oracle 叢集中沒有執行的節點,確保叢集中所有的節點都已啟動,如果由於作業系統原因不能啟動的節點,請先將此節點從叢集中刪除在執行私網網路變更。

3. 如果執行上面命令的的使用者非 GI 的擁有者,則會出現相同的錯誤:

$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect
PRIF-26: Error in update the profiles in the cluster

解決方案:確保使用 GI 的擁有者登入並執行上面命令。

4. 從 11.2.0.2 開始,如果在沒有加入一個新私有網路卡,就試圖刪除最後一個私有網路卡(叢集私網)則會發生下面錯誤:

PRIF-31: Failed to delete the specified network interface because it is the last private interface

解決方案:在刪除舊的私有網路卡之前,先加入新的私有網路卡。

5. 如果主機節點的 oracle 叢集關閉在關閉狀態,則會報下面錯誤:

$ oifcfg getif
PRIF-10: failed to initialize the cluster registry

解決方案:啟動該主機節點上的 oracle 叢集軟體。

 

關於 Windows 系統注意事項

更改網路卡的語法在 windows/RAC 和Unix/Linux 叢集是一樣的,但是網路卡名稱會略有不同,在 windows 系統上,預設分配給介面通常的名稱為:

Local Area Connection
Local Area Connection 1 
Local Area Connection 2

如果使用一個網路卡名稱含有空格,則名稱必須使用引號括起來,同時,請注意這是區分大小寫的。例如,在 windows上,設定叢集私網連結:

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 叢集安裝完成後需要更改網路卡名字,則需要執行”oifcfg”命令來新增新的網路卡並刪除舊的。綜上所述。

您可以執行下面命令檢視每個節點上可用的網路卡名字。

oifcfg iflist -p -n

必須在每個節點上執行這個命令來驗證網路卡名稱相同的定義。

使用 oifcfg 命令更改網路卡名字的影響

對於私網網路卡,資料庫將使用儲存在 OCR 中定義為叢集互聯的網路卡作為節點間快取融合通訊。在告警日誌開始的時候,就會顯示叢集互聯有效的資訊。在引數清單。例如:

For pre 11.2.0.2:
Cluster communication is configured to use the following interface(s) for this instance 
192.168.1.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.254.86.97

如果上面資訊不正確,則例項需要重啟以便 OCR 條目修正,這同樣適用於 ASM 例項和資料庫例項。在 windows 系統上,例項被關閉後,在 OCR 將被重讀之前,還需要停止/啟動 OracleService < SID >(或 OracleASMService < ASMSID > 。

 

Oifcfg 命令用法

檢視 oifcfg 命令的全部選項,只需輸入:

$ <CRS_HOME>/bin/oifcfg

 

例5 對於 11gR2 或以上版本的 HAIP 新增或刪除叢集私網

1. 新增另外的私有網路到現有的使用 HAIP 的叢集中,作為 grid 使用者執行:

$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect

例如:

$ oifcfg setif -global enp0s8/192.168.57.0:cluster_interconnect

 關閉 CRS 中的所有節點,通過重新啟動 crs 中的所有節點,來使 HAIP 讀入新的介面,不能使用滾動方式重啟。

2. 在使用 HAIP 的叢集中刪除私有網路,作為 grid 使用者執行:

$ oifcfg delif -global <if_name>

例如:
$ oifcfg delif -global enp0s8

HAIP 將切換至其它可用介面,在介面被刪除後,叢集/資料庫會繼續採用此方式執行。

刪除多餘的 HAIP 介面,應關閉 CRS 所有節點,然後重啟 CRS 所有節點。不能採用以滾動的方式重新啟動 CRS。

 

參考

NOTE:1386709.1 - The Basics of IPv4 Subnet and Oracle Clusterware
NOTE:276434.1 - How to Modify Public Network Information including VIP in Oracle Clusterware
NOTE:604958.1 - OCFS2 Node Fence Caused by Removing the External Network Cable
NOTE:1054902.1 - How to Validate Network and Name Resolution Setup for the Clusterware and RAC



How to Modify Private Network Information in Oracle Clusterware (文件 ID 283684.1)

In this Document

Goal
Solution
  Case I. Changing private hostname
  Case II. Changing private IP only without changing network interface, subnet and netmask
              or changing private IP MAC address only without changing anything else
  Case III. Changing private network MTU only
  Case IV. Changing private network interface name, subnet or netmask
  A. For pre-11gR2 Oracle Clusterware
  B. For 11gR2 Oracle Clusterware and 12c Cluster without Flex ASM
  C. For 12c Oracle Clusterware with Flex ASM
  Something to note for 11gR2+
  Notes for Windows Systems
  Ramifications of Changing Interface Names Using oifcfg
  Oifcfg Usage
  Case V. Add or remove cluster_interconnect for 11gR2 and above with HAIP
References


APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.2.0.1 [Release 10.1 to 12.2]
Information in this document applies to any platform.

GOAL

The purpose of this note is to describe how to change or update the private network (cluster_interconnect) information in Oracle Clusterware. 

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.   It may also be the case that for some reason, the Oracle Interface Configuration Assistant  ('oifcfg')  did not succeed during the installation.

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.

Note: for Oracle Engineered system (Exadata) and Oracle Database Appliance (ODA), please do not make such changes following this note.

 

SOLUTION

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' can be used to find out currently configured interfaces in OCR:

% $CRS_HOME/bin/oifcfg getif 
eth0 10.2.156.0 global public 
eth1 192.168.0.0 global cluster_interconnect

On Unix/Linux systems, the interface names are generally assigned by the OS, and standard names vary by platform. For Windows systems, see additional notes below. Above example shows currently interface eth0 is used for public with subnet 10.2.156.0, and eth1 for cluster_interconnect/private with subnet 192.168.0.0.

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. 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.

If the subnet or interface name for 'cluster_interconnect' interface is incorrect, it needs to be changed as crs/grid user.

Case I. Changing private hostname

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. Its associated IP can be changed. The only way to change private hostname is by deleting/adding nodes, or reinstall Oracle Clusterware.

In 11.2 Grid Infrastructure, private hostname is no longer recorded in OCR and there is no dependency on the private hostname. It can be changed freely in /etc/hosts.

Case II. Changing private IP only without changing network interface, subnet and netmask
              or changing private IP MAC address only without changing anything else

For example, private IP is changed from 192.168.1.10 to 192.168.1.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.

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.

Case III. Changing private network MTU only

For example, private network MTU is changed from 1500 to 9000 (enable jumbo frame), network interface name and subnet remain the same.

1. Shutdown Oracle Clusterware stack on all nodes
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. Restart Oracle Clusterware stack on all nodes

Case IV. Changing private network interface name, subnet or netmask

Note: When the netmask is changed but the subnet ID doesn't change, for example:
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.
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. Please note, this change can not be done in rolling manner.

When the netmask is changed, the associated subnet ID is often changed. Oracle only store network interface name and subnet ID in OCR, not the netmask. Oifcfg command can be used for such change, oifcfg commands only require to run on 1 of the cluster node, not all.

A. For pre-11gR2 Oracle Clusterware

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 eth3/192.168.2.0:cluster_interconnect
% $ORA_CRS_HOME/bin/oifcfg delif -global eth1/192.168.1.0

To verify the change
% $ORA_CRS_HOME/bin/oifcfg getif   
eth0 10.2.166.0 global public 
eth3 192.168.2.0 global cluster_interconnect

2. Shutdown Oracle Clusterware stack

As root user: # crsctl stop crs

3. Make required network change at OS level, /etc/hosts file should be modified on all nodes to reflect the change.
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. restart the Oracle Clusterware stack

As root user: # crsctl start crs

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.   For more information, please refer to Note 604958.1

 

B. For 11gR2 Oracle Clusterware and 12c Cluster without Flex ASM

As of 11.2 Grid Infrastructure, the private network configuration is not only stored in OCR but also in the gpnp profile.  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. 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. Please also note that manual modification of gpnp profile is not supported.

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. Ensure Oracle Clusterware is running on ALL cluster nodes in the cluster

2. As grid user:

Get the existing information. For example:

$ oifcfg getif
eth1 100.17.10.0 global public
eth0 192.168.0.0 global cluster_interconnect


Add the new cluster_interconnect information:

$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect

For example:
a. add a new interface bond0 with the same subnet
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect

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. 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. If the interface is available on the server, subnet address can be identified by command:
$ oifcfg iflist

It lists the network interface and its subnet address. This command can be run even if Oracle Clusterware is not running. 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.86

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. For 11gR2 and higher, it is not recommended to set cluster_interconnects in ASM or Database spfile or pfile. 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. Shutdown Oracle Clusterware on all nodes and disable the Oracle Clusterware as root user:

# crsctl stop crs
# crsctl disable crs


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. Enable Oracle Clusterware and restart Oracle Clusterware on all nodes as root user:

# crsctl enable crs
# crsctl start crs


6. Remove the old interface if required:

$ oifcfg delif -global <if_name>[/<subnet>]
eg:
$ oifcfg delif -global eth0/192.168.0.0

 

C. For 12c Oracle Clusterware with Flex ASM

Please review above section B and pay attention to the Note section, take a backup as follows:

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. Ensure Oracle Clusterware is running on ALL cluster nodes in the cluster

2. As grid user:

Get the existing information. For example:

$ oifcfg getif
eth1 100.17.10.0 global public
eth0 192.168.0.0 global cluster_interconnect,asm

Above example shows network eth0 is used for both cluster_interconnect and ASM network.

Add the new cluster_interconnect information:

$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect[,asm]

For example:
a. add a new interface bond0 with the same subnet
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect,asm

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

 If different network is used for private network and ASM network, then modify them accordingly.

3. As ASMLISTENER is using the private network, modifying the private network will affect ASMLISTENER. It is required to add a new ASMLISTENER with the new network configuration. Skip this step if the subnet for the ASM network is not changed.

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. 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

 

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 Verify the configuration

$ srvctl config listener -asmlistener
$ srvctl config asm


4. Shutdown Oracle Clusterware on ALL nodes and disable the Oracle Clusterware as root user:

# crsctl stop crs
# crsctl disable crs

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>

6. Enable Oracle Clusterware and restart Oracle Clusterware on all nodes as root user:

# crsctl enable crs
# crsctl start crs

7. Remove the old interface if required:

$ oifcfg delif -global <if_name>[/<subnet>]
eg:
$ oifcfg delif -global eth0/192.168.0.0

 

 

Something to note for 11gR2+


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.

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.

Above errors indicate a mismatch between OS setting (oifcfg iflist) and gpnp profile setting profile.xml.

Workaround: restore the OS network configuration back to the original status, start Oracle Clusterware. Then follow above steps to make the changes again. 

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. 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

Workaround: start Oracle Clusterware on the node where it is not running. Ensure Oracle Clusterware is up on all cluster nodes. If the node is down for any OS reason, please remove the node from the cluster before performing private network change.

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. 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. If Oracle Clusterware is down on the node, the following error is expected:

$ oifcfg getif
PRIF-10: failed to initialize the cluster registry

Workaround: Start the Oracle Clusterware on the node

 

Notes for Windows Systems

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

If using an interface name that has space in it, the name must be enclosed in quotes. 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

However, it is best practice on Windows to rename the interfaces to be more meaningful, such as renaming them to 'ocwpublic' and 'ocwprivate'.   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.

You can view the available interface names on each node by running the command:

oifcfg iflist -p -n

This command must be run on each node to verify the interface names are defined the same.

Ramifications of Changing Interface Names Using oifcfg

For the Private interface, the database will use the interface stored in the OCR and defined as a 'cluster_interconnect' for cache fusion traffic.  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.168.1.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.254.86.97

If this is incorrect, then instance is required to restart once the OCR entry is corrected. 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

To see the full options of oifcfg, simply type:

$ <CRS_HOME>/bin/oifcfg

 

Case V. Add or remove cluster_interconnect for 11gR2 and above with HAIP

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 enp0s8/192.168.57.0:cluster_interconnect

 Shutdown CRS on ALL nodes, then restart CRS on ALL nodes for HAIP to pick up the new interface. It is insufficient to restart CRS in rolling manner.


2. To remove a private network from a cluster with HAIP, as grid user:

$ oifcfg delif -global <if_name>

For example:
$ oifcfg delif -global enp0s8

HAIP will failover to the remaining interface and clusterware/database continue to function after the interface removal.

To remove the extra HAIP interface, it is required to shutdown CRS on ALL nodes, then restart CRS on ALL nodes. It is insufficient to restart CRS in rolling manner.

 

 

Database - RAC/Scalability Community
To discuss this topic further with Oracle experts and industry peers, we encourage you to review, join or start a discussion in the My Oracle Support Database - RAC/Scalability Community

REFERENCES

NOTE:1054902.1 - How to Validate Network and Name Resolution Setup for the Clusterware and RAC
NOTE:1386709.1 - The Basics of IPv4 Subnet and Oracle Clusterware
NOTE:276434.1 - How to Modify Public Network Information including VIP in Oracle Clusterware
NOTE:604958.1 - OCFS2 Node Fence Caused by Removing the External Network Cable






小麥苗課程

小麥苗課堂開課啦,如下是現有的課程,歡迎諮詢小麥苗:


課程名稱

課時

上課時間

價格

OCP(從入門到專家)

每年1期,35課時左右/

2000-2200

1588(可優惠)

OCM認證

每年N期,9課時/

2000-2200

22888

高可用課程(rac+dg+ogg

每年1期,20課時左右/

2000-2200

1888(可優惠)

Oracle初級入門

每年1期,15課時左右/

2000-2200

800

Oracle健康檢查指令碼

可微信或微店購買。

88

Oracle資料庫技能直通車

包含如下3個課程:

①《11g OCP網路課程培訓》(面向零基礎) 價值1600

②《11g OCM網路班課程培訓》(Oracle技能合集)價值10000+

③《RAC + DG + OGG 高可用網路班課程》 價值2000

以上3個課程全部打包只要5888,只要5888所有課程帶回家,終身指導!所有課程都是線上講課,不是播放視訊,課件全部贈送!

注意:以上OCPOCM課程只包括培訓課程,不包括考試費用。OCM提供培訓+視訊,但是不提供練習環境和資料。報名一次,OCP和高可用的課程可以免費終身迴圈聽課。

5888

OCP+高可用(rac+dg+ogg

報名OCP+高可用課程,可以優惠300元,優惠後的價格為3188.

3188(可優惠)

注意:

1、每次上課前30分鐘答疑。

2、OCM實時答疑,提供和考試一樣的練習模擬環境,只要按照老師講的方式來練習,可以保證100%通過。

3、授課方式:YY語音網路直播講課(非視訊) + QQ互動答疑 + 視訊複習

4、OCP課時可以根據大家學習情況進行增加或縮減。

5、以上所有課程均可迴圈聽課。

6、12c OCM課程私聊。

7、Oracle初級入門課程,只教大家最實用+最常用的Oracle操作維護知識。

8、以上所有課程,可以加小麥苗微信(lhrbestxh)或QQ(646634621)詳聊,優惠多多。
 


培訓專案

連線地址

DB筆試面試歷史連線

http://mp.weixin.qq.com/s/Vm5PqNcDcITkOr9cQg6T7w

OCP培訓說明連線

https://mp.weixin.qq.com/s/2cymJ4xiBPtTaHu16HkiuA

OCM培訓說明連線

https://mp.weixin.qq.com/s/7-R6Cz8RcJKduVv6YlAxJA

高可用(RAC+DG+OGG)培訓說明連線

https://mp.weixin.qq.com/s/4vf042CnOdAD8zDyjUueiw

OCP最新題庫解析歷史連線(052)

http://mp.weixin.qq.com/s/bUgn4-uciSndji_pUbLZfA

微店地址

https://weidian.com/s/793741433?wfr=c&ifr=shopdetail




About Me

.............................................................................................................................................

● 本文作者:小麥苗,部分內容整理自網路,若有侵權請聯絡小麥苗刪除

● 本文在itpub(http://blog.itpub.net/26736162/abstract/1/)、部落格園(http://www.cnblogs.com/lhrbest)和個人微信公眾號(xiaomaimiaolhr)上有同步更新

● 本文itpub地址:http://blog.itpub.net/26736162/abstract/1/

● 本文部落格園地址:http://www.cnblogs.com/lhrbest

● 本文pdf版、個人簡介及小麥苗雲盤地址:http://blog.itpub.net/26736162/viewspace-1624453/

● 資料庫筆試面試題庫及解答:http://blog.itpub.net/26736162/viewspace-2134706/

● DBA寶典今日頭條號地址:http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

.............................................................................................................................................

● QQ群號:230161599(滿)、618766405

● 微信群:可加我微信,我拉大家進群,非誠勿擾

● 聯絡我請加QQ好友646634621,註明新增緣由

● 於 2018-07-01 06:00 ~ 2018-07-31 24:00 在魔都完成

● 最新修改時間:2018-07-01 06:00 ~ 2018-07-31 24:00

● 文章內容來源於小麥苗的學習筆記,部分整理自網路,若有侵權或不當之處還請諒解

● 版權所有,歡迎分享本文,轉載請保留出處

.............................................................................................................................................

小麥苗的微店https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

小麥苗出版的資料庫類叢書http://blog.itpub.net/26736162/viewspace-2142121/

小麥苗OCP、OCM、高可用網路班http://blog.itpub.net/26736162/viewspace-2148098/

.............................................................................................................................................

使用微信客戶端掃描下面的二維碼來關注小麥苗的微信公眾號(xiaomaimiaolhr)及QQ群(DBA寶典)、新增小麥苗微信,學習最實用的資料庫技術。

小麥苗的微信公眾號小麥苗的DBA寶典QQ群2小麥苗的微信二維碼小麥苗的微店

   小麥苗的微信公眾號      小麥苗的DBA寶典QQ群2       小麥苗的微信二維碼          小麥苗的微店

.............................................................................................................................................

如何在 oracle 叢集環境下修改私網資訊 (文件 ID 2103317.1)
歡迎與我聯絡





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

相關文章