Oracle RAC

From Resin 3.0

Revision as of 19:36, 11 April 2008 by Sam (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.11 and one on 192.168.0.12. 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 Oraclew 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>

See also

Personal tools