Oracle Real Application Clusters Guard
Administration and Reference Guide Release 9.0.1 Part Number A88810-02 |
|
This chapter describes how to configure the Oracle network for Oracle Real Application Clusters Guard. It contains the following sections:
The following network configurations can be used with Oracle Real Application Clusters Guard:
These options are supported with Oracle Real Application Clusters Guard, but you must configure them according to the guidelines in this chapter. The decision about which type of connection to use depends on the resources available, as well as application and business needs.
Dedicated server environments do not have cross-instance listener registration. A connection request made to a specific instance's listener can be connected only to that instance's service. When the primary instance fails, the re-connection request from the client is rejected by the failed instance's listener. Oracle Real Application Clusters Guard stops the failed instance's listener and the IP address to which it was listening. Oracle Real Application Clusters Guard then restarts the IP address on the node where the secondary instance performs recovery and becomes the primary instance. When the client resubmits the request, the client re-establishes the connection using the new primary instance's listener that then connects the client to the new primary instance.
Oracle Real Application Clusters Guard uses the LOCAL_LISTENER
initialization parameter to specify the network name that resolves to an address of Oracle Net local listeners (listeners that are running on the same machine as the instance). The address is specified in the tnsnames.ora
file.
For example, if the LOCAL_LISTENER
initialization parameter is set to listener_SALES_HOSTA
, and listener_SALES_HOSTA
uses TPC/IP on port 1421, then the entry in the tnsnames.ora.ded.pfs
file looks like this:
listener_SALES_HOSTA= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1421))
Suppose the following Oracle Real Application Clusters Guard environment called SALES
exists:
Node 1 | Node 2 | |
---|---|---|
|
|
|
|
|
|
Listener |
|
|
Relocatable IP address |
144.25.28.74 |
144.25.28.75 |
Configure the LOCAL_LISTENER
parameter to allow for service registration. Then the following parameters are defined as shown in the following table:
Parameter | Node 1 | Node 2 |
---|---|---|
|
|
|
|
|
|
|
|
|
The values of the LOCAL_LISTENER
parameter can be resolved through the local tnsnames.ora
files on Nodes 1 and 2, respectively:
listener_SALES_HOSTA= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1421)) listener_SALES_HOSTB= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1421))
The following actions result from this configuration:
PMON
process for instance SALES1
registers with listener SALES_HOSTA_LSNR
.
The PMON
process for instance SALES2
registers with listener SALES_HOSTB_LSNR
.
You can confirm this by asking for a services summary on each node:
LSNRCTL> services SALES_HOSTA_LSNR Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1421) Services Summary... Service "sales.oracle.com" has 1 instances. Instance "SALES1" Status: READY Total handlers: 1 Relevant handlers: 1 DEDICATED established:6 refused:0 current:0 max:0 state:ready Session: NS LSNRCTL> services SALES_HOSTB_LSNR Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1421) Services Summary... Service "sales.oracle.com" has 1 instances. Instance "SALES2" Status: READY/SECONDARY Total handlers: 1 Relevant handlers: 1 DEDICATED established:11 refused:0 current:0 max:0 state:ready Session: NS
The connect descriptor contains addresses of listeners located on 144.25.28.74 and 144.25.28.75 that listen for connection requests for a database service called SALES.ORACLE.COM
with a primary instance role.
The connect descriptor address list features connect-time failover and no client load balancing. Connect-time failover is enabled by setting FAILOVER=ON
. When set to ON
, the FAILOVER
parameter instructs Oracle Net at connect time to fail over to 144.25.28.75 if the first address, 144.215.28.74, fails. The FAILOVER
parameter defaults to ON
for description lists, descriptions, and address lists.
The SALES_DED
net service name enables connections to the instance with the primary instance role. The SERVER=DEDICATED
specification forces a dedicated server connection.
SALES_DED= (DESCRIPTION= (LOAD_BALANCE=OFF) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1421)) (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1421))) (CONNECT_DATA= (SERVICE_NAME=SALES.ORACLE.COM) (SERVER=DEDICATED) (INSTANCE_ROLE=PRIMARY)))
Dynamic service registration relies on the PMON
process to register instance information with a listener, as well as the current state and load of the instance and shared server dispatchers. The registered information enables the listener to forward client connection requests to the appropriate service handler.
In Oracle Real Application Clusters Guard, the LISTENER
attribute in the DISPATCHER
initialization parameter has been configured to allow for dynamic service registration of information to both listeners, also referred to as cross-instance listener registration. The primary instance registers with the primary instance listener as well as the secondary instance listener. This enables the primary instance to accept connections from its local listener, as well as from the secondary instance listener. A secondary instance registers with its local listener as a secondary instance.
Suppose that the following Oracle Real Application Clusters Guard environment called SALES
exists:
Node 1 | Node 2 | |
---|---|---|
|
|
|
|
|
|
Listener |
|
|
Relocatable IP address |
144.25.28.74 |
144.25.28.75 |
Define the DISPATCHERS
initialization parameter on each node:
dispatchers=
"(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(LISTENER=listener_SALES)"
dispatchers=
"(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(LISTENER=listener_SALES)"
The listener value (listener_SALES
) can then be resolved through a local tnsnames.ora
file on both servers as follows, assuming that the listener alias name is listener_SALES
and the two ports are 1526:
listener_SALES=
DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1526))
(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1526)))
The following actions result from this configuration:
PMON
processes for the SALES1
and SALES2
instances register with both listeners. The listeners are updated dynamically with information about the load of the instances and dispatchers. You can confirm this by asking for a services summary on each node. Enter the following command:
$ lsnrctl
You should see output similar to the following:
LSNRCTL for Solaris: Version 9.0.1.0.0 - Production on 03-JAN-2001 13:54:16 (c) Copyright 2001 Oracle Corporation. All rights reserved. Welcome to LSNRCTL, type "help" for information.
Enter the following command:
LSNRCTL> set display normal
You should see output similar to the following:
Service display mode is NORMAL
Enter the following command:
LSNRCTL> services SALES_HOSTA_LSNR
You should see output similar to the following:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1526)(QUEUESIZE =1024))) Services Summary... Service "sales.oracle.com" has 2 instances. Instance "sales1" Status: READY Total handlers: 1 Relevant handlers: 1 D000 established:3 refused:0 current:0 max:1022 state:ready (ADDRESS=(PROTOCOL=tcp)(HOST=144.25.28.74)(PORT=60349)) Session: NS Instance "sales2" Status: READY/SECONDARY Total handlers: 1 Relevant handlers: 1 D000 established:0 refused:0 current:0 max:1022 state:ready (ADDRESS=(PROTOCOL=tcp)(HOST=144.25.28.75)(PORT=60858)) Session: NS The command completed successfully
The connect descriptors list specifies connect-time failover and no client load balancing. At connection time, Oracle Net fails over to 144.25.28.75 if the first address, 144.215.28.74, fails.
The SALES_MTS
net service name enables connections to the instance with the primary instance role.
If a shared server is specified and a client connection request arrives when no dispatchers are registered, then the request can be handled by a dedicated server process. Oracle Real Application Clusters Guard forces clients to always use a dispatcher because (SERVER=SHARED)
is configured in the connect data portion of the connect descriptor. If a dispatcher is not available, the client connection request is rejected.
The client connect descriptor uses an address list that contains the listener addresses for the primary instance and the secondary instance. The LOAD_BALANCE
parameter is set to OFF
because all client connections should go to the primary instance.
For example, define SALES_MTS
as follows:
SALES_MTS= (DESCRIPTION=
(LOAD_BALANCE=OFF)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1526))
(ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1526)))
(CONNECT_DATA=
(SERVICE_NAME=SALES.ORACLE.COM)
(SERVER=SHARED) (INSTANCE_ROLE=PRIMARY)))
Transparent application failover (TAF) instructs Oracle Net to fail over an established connection to a different listener. This enables the user to continue to work, using the new connection as if the original connection had not failed. Using TAF requires manual configuration of a net service name that includes the FAILOVER_MODE
parameter in the CONNECT_DATA
portion of the connect descriptor.
This section includes the following topics:
In this example of a TAF basic dedicated connection, the TAF application first tries to connect to the 144.25.28.74 IP address. If it cannot connect, then it attempts to perform a connect-time failover to 144.25.27.75. If the instance fails after the connection, then the TAF application fails over to the other node's listener, reserving SELECT
statements that are in progress. If the failover connection attempt fails, then Oracle Net waits 5 seconds before trying to connect again. Oracle Net attempts to connect up to 180 times.
SALES_DED_BASIC= (DESCRIPTION= (LOAD_BALANCE=OFF) (FAILOVER=ON) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1524)) (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1524))) (CONNECT_DATA= (SERVICE_NAME=SALES.ORACLE.COM) (SERVER=DEDICATED) (INSTANCE_ROLE=PRIMARY) (FAILOVER_MODE= (BACKUP=SALES_DED_BASIC_BACKUP) (TYPE=SELECT) (METHOD=BASIC) (RETRIES=180) (DELAY=5)))) SALES_DED_BASIC_BACKUP= (DESCRIPTION= (LOAD_BALANCE=OFF) (FAILOVER=ON) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1524)) (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1524))) (CONNECT_DATA= (SERVICE_NAME=SALES.ORACLE.COM) (SERVER=DEDICATED) (INSTANCE_ROLE=PRIMARY) (FAILOVER_MODE= (BACKUP=SALES_DED_BASIC) (TYPE=SELECT) (METHOD=BASIC) (RETRIES=180) (DELAY=5))))
When TAF is configured, a back-up connection can be pre-established to the secondary instance. The initial and back-up connections are specified explicitly. In the following example, Oracle Net connects to the listener on HOSTA
and establishes a pre-connection to HOSTB
, the secondary instance. If HOSTA
fails after the connection, then the TAF application fails over to HOSTB
. The RETRIES
and DELAY
parameters cause Oracle Net to automatically try to connect again if the first connection attempt fails.
In the following example of a TAF pre-established dedicated connection, the TAF application tries to connect to the 144.25.28.74 address first. If it cannot, then Oracle Net attempts connect-time failover to 144.25.27.75. A back-up connection is pre-established. If the instance fails after the connection, then the TAF application fails over to the other node's listener, reserving any SELECT
statements in progress. If the failover connection attempt fails, then Oracle Net waits 5 seconds before trying to connect again. Oracle Net attempts to connect up to 180 times.
SALES_DED_PRE= (DESCRIPTION= (LOAD_BALANCE=OFF) (FAILOVER=ON) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1524)) (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1524))) (CONNECT_DATA= (SERVICE_NAME=SALES.ORACLE.COM) (SERVER=DEDICATED) (INSTANCE_ROLE=PRIMARY) (FAILOVER_MODE= (BACKUP=SALES_DED_PRE_SECONDARY) (TYPE=SELECT) (METHOD=PRECONNECT) (RETRIES=180) (DELAY=5)))) SALES_DED_PRE_SECONDARY= (DESCRIPTION= (LOAD_BALANCE=OFF) (FAILOVER=ON) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.75)(PORT=1524)) (ADDRESS=(PROTOCOL=TCP)(HOST=144.25.28.74)(PORT=1524))) (CONNECT_DATA= (SERVICE_NAME=SALES.ORACLE.COM) (SERVER=DEDICATED) (INSTANCE_ROLE=SECONDARY) (FAILOVER_MODE= (BACKUP=SALES_DED_PRE) (TYPE=SELECT) (METHOD=PRECONNECT) (RETRIES=48) (DELAY=900))))
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|