VIP Commands
Use commands with the vip keyword to add, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove a VIP.
srvctl add vip
Adds a virtual IP address (VIP) to a node.
Syntax
srvctl add vip -node node_name -address {VIP_name|ip}/netmask/if1
-netnum network_number [-skip] [-verbose]
Parameters
Table: srvctl add vip Command Parameters
| Parameter | Description |
|---|---|
-node node_name | The name of the node on which you are adding the VIP. |
-address { VIP_name | ip }/ netmask / if1 | This specification creates a traditional VIP node application on the specified node. You can specify one |
-netnum network_number | The network number from which VIPs are obtained. The default network number is 1. |
-skip | Specify this parameter to skip checking the reachability of the VIP address. |
-verbose | Verbose output |
Usage Notes
- You cannot have multiple VIPs on the same net number (subnet or interface pair) on the same node.
- This command is only available with Oracle Clusterware.
Example
An example of this command is:
# srvctl add network -netnum 2 -subnet 192.168.16.0/255.255.255.0
# srvctl add vip -node node7 -address 192.168.16.17/255.255.255.0 -netnum 2
The first command creates a network number, 2, and the second command adds a VIP to this network. You can specify the network number after the -netnum parameter in other SRVCTL commands.
srvctl config vip
Displays all VIPs on all networks in the cluster except for user VIPs.
Syntax
srvctl config vip {-node node_name | -vip vip_name} [-exportfile file_name]
Parameters
Table: srvctl config vip Command Parameters
| Parameter | Description |
|---|---|
-node node_name | Specify the node name. |
-vip vip_name | Alternatively, you can specify the VIP name. |
-exportfile file_name | Specify the output file to which the resource configuration will be exported in JSON format for backup or resource re-creation purposes. |
Usage Notes
This command is only available with Oracle Clusterware.
Example
This command returns output similar to the following:
$ srvctl config vip -node crmnode1
VIP exists: ipv4, ipv6, network number 1, hosting node adc2100252
srvctl disable vip
Disables a specific VIP.
Syntax
srvctl disable vip -vip vip_name [-verbose]
Usage Notes
- This command is only available with Oracle Clusterware.
- Specify the name of the VIP you want to disable.
- Optionally, you can use the
-verboseparameter to display detailed output.
Example
The following command disables a VIP:
$ srvctl disable vip -vip vip1 -verbose
srvctl enable vip
Enables a specific VIP.
Syntax
srvctl enable vip -vip vip_name [-verbose]
Usage Notes
- You can only use this command with Oracle Clusterware.
- Specify the name of the VIP you want to enable.
- Optionally, you can use the
-verboseparameter to display detailed output.
Example
The following example enables a VIP named crm1-vip:
$ srvctl enable vip -vip crm1-vip -verbose
srvctl getenv vip
Obtains the values of environment variables for a specific VIP.
Syntax
srvctl getenv vip -vip vip_name [-envs "name_list"] [-verbose]
Parameters
Table: srvctl getenv vip Command Parameters
| Parameter | Description |
|---|---|
-vip vip_name | Specify the name of the VIP for which you want to obtain the values of the environment variables. |
-envs " name_list " | Optionally, you can specify a comma-delimited list of the names of specific environment variables. If you do not use this parameter, then SRVCTL displays the values of all environment variables associated with the VIP. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example lists all environment variables for the specified VIP:
$ srvctl getenv vip -vip node1-vip
srvctl modify vip
Modify the VIP's IP address type or change the IP address only.
Syntax
srvctl modify vip -node node_name -address {VIP_name1|IP1}/netmask1[/if1[|if2...]]
[,{VIP_name2|IP2}/netmask2[/if1[|if2...]]] [-netnum network_number] [-skip] [-verbose]
Parameters
Table: srvctl modify vip Command Parameters
| Parameter | Description |
|---|---|
-node node_name | Specify the name of the node on which you are changing the VIP. |
-address {VIP_name|ip}/netmask[/ if1 [| if2 ...]] | Use this parameter to change the configuration of an existing VIP. If the VIP has an IPv4 address and the address you specify is IPv6, and the IP address type is set to You can specify one |
-address { VIP_name1 |IP1}/ netmask1 [/ if1 [| if2 ...]],{ VIP_name2 |IP2}/ netmask2 [/ if1 [| if2 ...]] | Use this syntax to specify primary and secondary VIP address specifications for node applications. The syntax with both VIP address specifications is used to add a new VIP host name or VIP IP address to an existing VIP resource when the network has been modified to have two subnets. The VIP_name1 (or IP1) and netmask1 must match the current VIP address specification. VIP_name2 (or IP2) and netmask2 are for the additional VIP address specification. |
-netnum network_number | Optionally, specify the network number from which VIPs are obtained. If you do not use this parameter, then SRVCTL obtains the VIPs from the default network used for the nodeapps VIP. |
-skip | Optionally, you can skip the reachability check of VIP address. |
-verbose | Optionally, you can use this parameter to display detailed output. |
Usage Notes
- You can only use this command with Oracle Clusterware.
- You cannot have multiple VIPs on the same net number (subnet or interface pair) on the same node.
Examples
The following example adds an IPv4 address to a VIP, if one does not already exist. If the VIP has an IPv4 address, then it is replaced with the new network specification.
# srvctl modify vip -node node7 -address 192.168.16.17/255.255.255.0 -netnum 2The following example updates the VIP configuration for
node7by specifying both the current and new VIP addresses, each associated with separate subnets and interfaces.# srvctl modify vip -node node7 -address myvip1/255.255.255.0/eth0,myvip2/255.255.254.0/eth1 -netnum 2Where:
myvip1/255.255.255.0/eth0is the current VIP address, netmask, and interface.myvip2/255.255.254.0/eth1is the new VIP address, netmask, and interface.- The
-netnum 2parameter specifies the network number from which VIPs are obtained.
srvctl predict vip
Predicts the consequences of VIP failure.
Syntax
srvctl predict vip [-vip vip_name] [-verbose]
Usage Notes
- Optionally, you can specify the name of a VIP for which you want to evaluate the consequences of failure.
- Optionally, you can use the
-verboseparameter to display detailed output.
srvctl relocate vip
Relocates a specific VIP from its current hosting node to another node within the cluster.
Syntax
srvctl relocate vip -vip vip_name [-node node_name] [-force] [-verbose]
Parameters
Table: srvctl relocate vip Command Parameters
| Parameter | Description |
|---|---|
-vip vip_name | Specify the name of the VIP you want to relocate. |
-node node_name | Optionally, you can specify the name of the target node where you want to relocate the VIP. |
-force | Optionally, you can use this parameter to force the relocation of the VIP regardless of any dependencies. |
-verbose | Optionally, you can use this parameter to display detailed output. |
Example
The following example relocates a VIP to a different node in the cluster:
$ srvctl relocate vip -vip vip1 -node node3
srvctl remove vip
Removes the specified VIPs.
Syntax
srvctl remove vip -vip "vip_name_list" [-force] [-noprompt] [-verbose]
Parameters
Table: srvctl remove vip Command Parameters
| Parameter | Description |
|---|---|
-vip " vip_name_list " | Specify a comma-delimited list of VIP names that you want to remove surrounded by double quotation marks ( "" ). |
-force | Optionally, you can use this parameter to remove a VIP regardless of any dependencies. |
-noprompt | Optionally, you can use this parameter to suppress prompts. |
-verbose | Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example removes several VIPs from the system:
# srvctl remove vip -vip "vip1,vip2,vip3" -force -noprompt -verbose
srvctl setenv vip
Administers cluster VIP environment configurations.
Syntax
srvctl setenv vip -vip vip_name {-envs "name=val[,...]" | -env "name=val"}
[-verbose]
Parameters
Table: srvctl setenv vip Command Parameters
| Parameter | Description |
|---|---|
-vip vip_name | Specify the name of the VIP for which you want to set environment variables. |
-envs " name = val [,...]" | Specify a comma-delimited list of name-value pairs of environment variables enclosed in double quotation marks ( "" ) that you want to set. |
-env " name = val" | Alternative to a list of environment variables, you can use this parameter to set a single environment variable to a value that contains commas or other special characters enclosed in double quotation marks ( "" ). |
-verbose | Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example sets the language environment configuration for a cluster VIP:
$ srvctl setenv vip -vip crm1-vip -env "LANG=en"
srvctl start vip
Starts a specific VIP or a VIP on a specific node.
Syntax
srvctl start vip {-node node_name | -vip vip_name} [-verbose]
Parameters
Table: srvctl start vip Command Parameters
| Parameter | Description |
|---|---|
-node node_name | Specify the name of the node on which the VIP resides that you want to start. |
-vip vip_name | Alternative to specifying a node, you can specify a VIP that you want to start. |
-verbose | Optionally, you can use this parameter to display detailed ouptut. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example starts a specific VIP:
$ srvctl start vip -vip crm1-vip -verbose
srvctl status vip
Displays status for a specific VIP or a VIP on a specific node.
Syntax
srvctl status vip {-node node_name | -vip vip_name} [-verbose]
Parameters
Table: srvctl status vip Command Parameters
| Parameter | Description |
|---|---|
-node node_name | Specify the name of the node on which the VIP resides that you want to check the status. |
-vip vip_name | Alternative to specifying a node, you can specify a VIP that you want to check the status. |
-verbose | Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
srvctl stop vip
Stops a specific VIP or all VIPs on a specific node, including any VIPs that were relocated due to a failover.
Syntax
srvctl stop vip {-node node_name | -vip vip_name} [-force] [-relocate] [-verbose]
Parameters
Table: srvctl stop vip Command Parameters
| Parameter | Description |
|---|---|
-node node_name | Specify the name of a node on which a VIP resides that you want to stop. If you use this parameter, then SRVCTL stops all VIPs on the specific node, including failed-over VIPs. |
-vip vip_name | Alternative to specifying a node, you can specify a VIP that you want to stop. |
-force | Optionally, you can use this parameter to stop the VIP regardless of any dependencies. |
-relocate | Optionally, you can use this parameter to relocate the VIP. Note: You must use the |
-verbose | Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example stops all the VIPs on mynode1, including any failed-over VIPs:
$ srvctl stop vip -node mynode1 -verbose
srvctl unsetenv vip
Unsets the environment configuration for the specified cluster VIP.
Syntax
srvctl unsetenv vip -vip "vip_name_list" -envs "name_list" [-verbose]
Parameters
Table: srvctl unsetenv vip Command Parameters
| Parameter | Description |
|---|---|
-vip " vip_name_list " | Specify a comma-delimited list of VIP names enclosed in double quotation marks ( "" ). |
-envs " name_list " | Specify a comma-delimited list of environment variable names enclosed in double quotation marks ( "" ) that you want to unset. |
-verbose | Optionally, you can use this parameter to display detailed output. |
Example
The following example unsets the CLASSPATH environment variable for a cluster VIP:
$ srvctl unsetenv vip -vip "crm2-vip" -envs "CLASSPATH"