【RAC】Oracle rac 如何修改公網及vip
In this Document
|
Purpose |
|
Scope |
|
Details |
|
Case I. Changing public hostname |
|
Case II. Changing public IP or VIP only without changing interface, subnet or netmask or changing MAC address only without changing anything else |
|
Case III. Changing public network interface, subnet or netmask |
|
Case IV. Changing VIPs associated with public network change |
|
Planning for VIP changes |
|
Gathering Current VIP Configuration |
|
Stopping Resources |
|
Modifying VIP and Its Associated Attributes |
|
Restarting Resources |
|
Others |
|
Case V. Change SCAN VIP associated with public network change |
|
References |
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.2.0.1 [Release 10.1 to 12.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
PURPOSE
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 and 11g use VIPs (Virtual IP) in clustered environments for clients to connect to the database. These VIPs are static IP addresses associated with (virtual) hostnames and resolved through DNS (except when using 11gR2 GNS).
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. These are stored within the OCR (Oracle Cluster Registry) and different components within the HA framework depend on these VIPs. 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.
DETAILS
Case I. Changing public hostname
Public hostname is recorded in OCR, it is entered during installation phase. It can not be modified after the installation. 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.
Case II. Changing public IP or VIP only without changing interface, subnet or netmask or changing MAC address only without changing anything else
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. Shutdown Oracle Clusterware stack
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. Restart Oracle Clusterware stack
Above change can be done in rolling fashion, eg: one node at a time.
Case III. Changing public network interface, subnet or netmask
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. 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 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
Then make the change at OS layer. There is no requirement to restart Oracle clusterware unless OS change requires a node reboot. This can be done in rolling fashion.
Once public network is changed, its associated VIP and SCAN VIP are also required to change, refer to CASE IV and CASE V.
[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.
Case IV. Changing VIPs associated with public network change
Planning for VIP changes
In general, a complete outage is only required for pre-10.2.0.3 release. 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. If the modification is a node specific, then only connection to that node will be affected during the time of change.
Please follow Case III to ensure public network changes are made first. 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".
Gathering Current VIP Configuration
1. Gather the existing setup
for 10g and 11gR1, as Oracle Clusterware owner:
eg:
$ srvctl config nodeapps -n <nodename>1 -a
VIP exists.: /<nodename>1-vip/101.XX.XX.184/255.255.254.0/<if_name>
for 11gR2, as Grid Infrastructure owner:
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. Verify VIP status
$ crs_stat -t
11.2:
$ crsctl stat res -t
- it should show VIPs are ONLINE
$ ifconfig -a
(netstat -in for HP and ipconfig /all for Windows)
- VIP logical interface is bound to the public network interface
Stopping Resources
3. Stop the nodeapps resources (and all dependent resources ASM/DB only if required):
10g and 11gR1, as Oracle Clusterware owner:
$ 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 vip -n <node_name> -f
eg,
$ srvctl stop instance -d <DBNAME> -n <nodename>1
$ srvctl stop vip -n <nodename>1 -f
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. Verify VIP is now OFFLINE and the interface is no longer bound to the public network interface
$ ifconfig -a
(netstat -in for HP and ipconfig /all for windows)
Modifying VIP and Its Associated Attributes
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). If the network interface is changed, ensure the new interface is available on the server before proceeding with the modification.
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. Modify the VIP resource, as
root user:
eg:
# srvctl modify nodeapps -n <nodename>1 -A <nodename>1-nvip/255.255.255.0/<if_name>
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>
There is no need to modify VIP or SCAN if other attributes are not changed.
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"
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
The bug has been fixed in 12.1.0.2 and above.
* A special case for 11gR2 modifying the VIP hostname only without changing the IP address.
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
Verify the changes for USR_ORA_VIP field:
# crsctl stat res ora.<nodename>1.vip -p |grep USR_ORA_VIP
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. Verify the change
$ 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. Start the nodeapps and the other resources
10g and 11gR1, as Oracle Clusterware owner:
$ 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 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
Note: if the network attributes are changed, i.e. netmask changed, restart the nodeapps
9. Verify the new VIP is ONLINE and bind to the public network interface
$ ifconfig -a
(netstat -in for HP or ipconfig /all for windows)
10. Repeat the same steps for the rest nodes in the cluster only if the similar change is required.
Others
11. Modify listener.ora, tnsnames.ora and LOCAL_LISTENER/REMOTE_LISTENER parameter to reflect the VIP change if necessary.
Case V. Change SCAN VIP associated with public network change
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
REFERENCES
NOTE:952903.1
- How to Update the IP Address of the SCAN VIP Resources (ora.scan{n}.vip)
NOTE:283684.1
- How to Modify Private Network Information in Oracle Clusterware
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29487349/viewspace-2784621/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RAC如何修改VIP
- 【RAC】Oracle RAC如何修改心跳網路Oracle
- Oracle RAC修改public, VIP, SCAN IPOracle
- ORACLE10g修改RAC VIPOracle
- Oracle RAC修改IP和VIP地址Oracle
- 【RAC】如何修改vip 或者vip 對應的hostname
- Oracle RAC修改public,private,vip scan IPOracle
- RAC中修改IP, VIP
- RAC 11.2.0.3 修改VIP地址
- oracle 11g rac 修改VIP、scan VIP、priv IP操作文件Oracle
- 修改oracle 10g rac(rhel4)的vipOracle 10g
- 基於同網段的RAC架構VIP修改架構
- 基於不同網段的RAC架構VIP修改架構
- 基於RedHat的RAC環境下修改ip及vipRedhat
- 10g RAC中修改VIP地址
- oracle rac vip 漂移過程Oracle
- 【RAC】Oracle rac修改IP地址及埠號命令參考Oracle
- 關於 RAC VIP (Oracle10G RAC) 的探討(zt)Oracle
- rac vip failback issueAI
- oracle10g RAC更改主機public地址及vip地址Oracle
- RAC中如何更改對外網路卡和內部網際網路卡的IP及VIP
- Oracle RAC 修改 IP 地址Oracle
- RAC_網路_VIP漂移_SCAN IP
- 【RAC】如何修改 private ip
- Oracle 10g RAC vip 漂移問題Oracle 10g
- RAC更改叢集VIP
- 配置RAC中的VIP
- rac 改public 及vip IP---備份01
- oracle rac 修改 miscount的方法 。Oracle
- oracle rac的vip與srvctl啟動關係Oracle
- 【VIP】調整RAC虛擬IP地址(VIP)及虛擬主機名
- RAC改VIP和SCAN IP
- 關於 rac vip fail backAI
- Oracle RAC修改網路配置知識點彙總Oracle
- ORACLE RAC 環境下修改IPOracle
- Oracle9i RAC 修改IPOracle
- (轉)【VIP】調整RAC虛擬IP地址(VIP)及虛擬主機名
- 如何修改叢集的公網資訊(包括 VIP) (文件 ID 1674442.1)