How to change VIP and VIP/Hostname in 10g

lfree發表於2006-09-06

http://www.itpub.net/618614.html

Doc ID: Note:271121.1 Type: BULLETIN
Last Revision Date: 12-JAN-2005 Status: PUBLISHED


***
This article is being delivered in Draft form and may contain
errors. Please use the MetaLink "Feedback" button to advise
Oracle of any issues related to this article.
***

PURPOSE
-------
Oracle 10g uses VIP (Virtual IP) for clients to connect to the database. VIP solves all time-outs entering the TCP/IP stack resulting
in higher application availability. This VIP is a static IP with a hostname defined and resolved thru DNS. During the installation
of CRS users are prompted to enter a Virtual IP and Virtual Hostname for each of the nodes in the cluster. These are stored in OCR,
and various components within the 10g HA framework depends on these VIPs. If for some reason there is a need to change either the VIP or the VIP/Hostname use the following procedure.


SCOPE & APPLICATION
-------------------
Customers want to change the VIP or VIP/Hostname.


How to change the VIP address only:
-----------------------------------

1. Stop all node-level applications.

Use the srvctl stop nodeapps command with the following syntax:

srvctl stop nodeapps -n

The only option for this command is the -n option, which specifies the node name.

Note: This will stop the VIP, GSD, Listener, and ONS daemons currently running on the node specified

2. Apply a new virtual IP address to nodeapps (You must be root user).

Use the srvctl modify nodeapps command with the following syntax:

srvctl modify nodeapps -n [-o ] [-A ]

Options Description:
-n Node name.
-o Oracle home for the cluster database.
-A The node level VIP address (/netmask[/if1[|if2|...]]).

3. Configure the network interface for the VIP (You must be root user).

Use the ifconfig command to configure the network interface

ifconfig interface [aftype] options | address ...

Option Description should be reviewed using unix man pages

4. Start node-level applications.

Use the srvctl start nodeapps command with the following syntax:

srvctl start nodeapps -n

The only option available for this command is -n to specify the node name.

5. Start the ASM.

Use the srvctl start asm command with the following syntax:

srvctl start asm -n [-i ] [-o ]

Option Description:
-n Node name
-i ASM instance name.
-o Options to startup command (for example: open, mount, ornomount)

6. Start the database instance.

Use the srvctl start instance command with the following

srvctl start instance -d -i [-o ] [-c | -q]

Option Description:
-d Unique name for the database.
-i Comma-separated instance names.
-o Options for startup command (for example: open, mount, or nomount).
-c Connect string (default: / as sysdba).
-q Prompt for user credentials connect string from standard input.


The following is an example of the commands to change the VIP address on a node:

srvctl stop nodeapps -n mynode1
srvctl modify nodeapps -n mynode1 -A 138.2.166.152/255.255.255.0
/sbin/ifconfig eth0:1 138.2.166.152
srvctl start nodeapps -n mynode1
srvctl start asm -n stress21
srvctl start instance -d rac -i rac3

Repeat the same steps for all the nodes in the cluster. SRVCTL is a cluster wide management tool you can accomplish the task for all nodes from one node without having to login to each of the cluster nodes.



How to change the VIP and Hostname:
-----------------------------------

If you want to change the VIP and Hostname use the following steps:

1. Stops all node-level applications.

Use the srvctl stop nodeapps command with the following syntax:

srvctl stop nodeapps -n

The only option for this command is the -n option, which specifies the node name.

Note: This will stop the VIP, GSD, Listener, and ONS daemon currently running on the nodes specified.

2. Remove the node application configuration.

Use the srvctl remove nodeapps command as follows:

srvctl remove nodeapps -n [-f]

Options Description
-n Node name or a comma-separated list of node names.
-f Force remove.

Note: You must have full administrative privileges to run this command. On UNIX-based systems, you must be logged in as root and on Windows-based systems, you must be logged in as a user with Administrator privileges.

3. Use NETCA to remove listener configuration.

4. Use VIPCA (as root) to create and configure new VIP/Hostname.

Note: VIPCA creates VIP,GSD, Listener, and ONS resource applications for each node in the cluster. VIPCA is the only recommended way.

5. Use NETCA to create listener configuration.


The following is an example of the commands to change the hostname and VIP address on the nodes in the cluster:

This example assumes we have a 2 node cluster and want to change the VIP/Hostname in all nodes.

srvctl stop nodeapps -n mynode1
srvctl stop nodeapps -n mynode2
srvctl remove nodeapps -n mynode1
srvctl remove nodeapps -n mynode2
use netca to remove the network configuration files
use vipca to create and configure the cluster ready services
use netca to create the network configuration files

Note: NETCA and VIPCA should be run on one node to effect the change for the cluster as a whole. Also in srvctl
nodeapps, the –n option takes only one node name for all commands except for remove command. For simplicity we used only one node name in all commands.

Caution: This note can only be used to change VIP or Hostname associated with VIP or both. It should not be used to change the public hostname or its I


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

相關文章