Oracle RAC
From Resin 3.0
(→Resin round-robin database load balancing) |
|||
Line 1: | Line 1: | ||
+ | {{Cleanup}} | ||
+ | |||
Two approaches are available for Oracle RAC. | Two approaches are available for Oracle RAC. | ||
Latest revision as of 17:37, 1 December 2011
This article requires cleanup and may refer to a legacy version of Resin.
Please visit http://www.caucho.com/documentation/ for the most up-to-date documentation. |
Two approaches are available for Oracle RAC.
Resin round-robin database load balancing
Resin has the ability to provide for the configuration of multiple drivers and round robin load balancing. The following example shows configuration for an Oracle RAC system that has two Oracle servers, one on 192.168.0.110 and one on 192.168.0.111. Configurations with more than two Oracle servers are possible, just add a <driver> ... </driver> for each server.
<database>
<name>jdbc/oracle</name>
<driver>
<type>oracle.jdbc.pool.OracleConnectionPoolDataSource</type>
<url>jdbc:oracle:thin:@192.168.0.110:1521:CHANGEME_DBNAME</url>
<user>CHANGEME</user>
<password>CHANGEME</password>
</driver>
<driver>
<type>oracle.jdbc.pool.OracleConnectionPoolDataSource</type>
<url>jdbc:oracle:thin:@192.168.0.111:1521:CHANGEME_DBNAME</url>
<user>CHANGEME</user>
<password>CHANGEME</password>
</driver>
<ping>true</ping>
<ping-table>CHANGEME_TABLENAME</ping-table>
</database>
Resin will use a round robin load balancer to distribute the requests across the two Oracle servers.
Oracle driver load balancing
The Oracle driver itself can be configured to handle the Oracle RAC system. With that configuration the Oracle driver is responsible for load balancing connection requests to the backend Oracle servers. From Resin's point of view the connection looks the same as a connection to a single Oracle instance.
There is no Resin specific special configuration, the configuration of the driver is accomplished by specifying a potentially very long and complicated url to the Oracle driver. The Oracle documentation is the place to look for configuration details.
<database>
<name>jdbc/oracle</name>
<driver>
<type>oracle.jdbc.pool.OracleConnectionPoolDataSource</type>
<url>jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cluster_alias)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=service_name)))</url>
<user>CHANGEME</user>
<password>CHANGE<E</password>
<connection-caching-enabled>true</connection-caching-enabled>
<fast-connection-failover-enabled>true</fast-connection-failover-enabled>
</driver>
</database>